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