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