aboutsummaryrefslogtreecommitdiff
path: root/_posts/posts/2020-09-08-bind-warning-on-login.md
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-03-10 14:59:14 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-03-10 14:59:14 +0100
commit1100562e29f6476448b656dbddd4cf22505523f6 (patch)
tree442eec492199104bd49dfd74474ce89ade8fcac9 /_posts/posts/2020-09-08-bind-warning-on-login.md
parenta40d80be378e46a6c490e1b99b0d8f4acd968503 (diff)
downloadmitjafelicijan.com-1100562e29f6476448b656dbddd4cf22505523f6.tar.gz
Move back to JBMAFP
Diffstat (limited to '_posts/posts/2020-09-08-bind-warning-on-login.md')
-rw-r--r--_posts/posts/2020-09-08-bind-warning-on-login.md55
1 files changed, 0 insertions, 55 deletions
diff --git a/_posts/posts/2020-09-08-bind-warning-on-login.md b/_posts/posts/2020-09-08-bind-warning-on-login.md
deleted file mode 100644
index 4b2c983..0000000
--- a/_posts/posts/2020-09-08-bind-warning-on-login.md
+++ /dev/null
@@ -1,55 +0,0 @@
1---
2title: Fix bind warning in .profile on login in Ubuntu
3permalink: /bind-warning-on-login-in-ubuntu.html
4date: 2020-09-08T12:00:00+02:00
5layout: post
6type: post
7draft: false
8---
9
10Recently I moved back to [bash](https://www.gnu.org/software/bash/) as my
11default shell. I was previously using [fish](https://fishshell.com/) and got
12used to the cool features it has. But, regardless of that, I wanted to move to a
13more standard shell because I was hopping back and forth with exporting
14variables and stuff like that which got pretty annoying.
15
16So I embarked on a mission to make [bash](https://www.gnu.org/software/bash/)
17more like [fish](https://fishshell.com/) and in the process found that I really
18missed autosuggest with TAB on changing directories.
19
20I found a nice alternative that emulates [zsh](http://zsh.sourceforge.net/) like
21autosuggestion and autocomplete so I added the following to my `.bashrc` file.
22
23```bash
24bind "TAB:menu-complete"
25bind "set show-all-if-ambiguous on"
26bind "set completion-ignore-case on"
27bind "set menu-complete-display-prefix on"
28bind '"\e[Z":menu-complete-backward'
29```
30
31I haven't noticed anything wrong with this and all was working fine until I
32restarted my machine and then I got this error.
33
34![Profile bind error](/assets/posts/profile-bind-error/error.jpg){:loading="lazy"}
35
36When I pressed OK, I got into the [Gnome
37shell](https://wiki.gnome.org/Projects/GnomeShell) and all was working fine, but
38the error was still bugging me. I started looking for the reason why this is
39happening and found a solution to this error on [Remote SSH Commands - bash bind
40warning: line editing not enabled](https://superuser.com/a/892682).
41
42So I added a simple `if [ -t 1 ]` around `bind` statements to avoid running
43commands that presume the session is interactive when it isn't.
44
45```bash
46if [ -t 1 ]; then
47 bind "TAB:menu-complete"
48 bind "set show-all-if-ambiguous on"
49 bind "set completion-ignore-case on"
50 bind "set menu-complete-display-prefix on"
51 bind '"\e[Z":menu-complete-backward'
52fi
53```
54
55After logging out and back in the problem was gone.