aboutsummaryrefslogtreecommitdiff
path: root/posts/2020-09-08-bind-warning-on-login.md
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2022-08-27 14:05:48 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2022-08-27 14:05:48 +0200
commit9f5454bda6299db43a4e9de5b3716471388b81d9 (patch)
tree1ceedf64a4517a372d70efc2b6f4bbd9478ce792 /posts/2020-09-08-bind-warning-on-login.md
parente728c3a2cbd06d95cd1226d3b23473816bd0d67e (diff)
downloadmitjafelicijan.com-9f5454bda6299db43a4e9de5b3716471388b81d9.tar.gz
Move blog to Hugo
Diffstat (limited to 'posts/2020-09-08-bind-warning-on-login.md')
-rw-r--r--posts/2020-09-08-bind-warning-on-login.md42
1 files changed, 0 insertions, 42 deletions
diff --git a/posts/2020-09-08-bind-warning-on-login.md b/posts/2020-09-08-bind-warning-on-login.md
deleted file mode 100644
index ab26b0c..0000000
--- a/posts/2020-09-08-bind-warning-on-login.md
+++ /dev/null
@@ -1,42 +0,0 @@
1---
2Title: Fix bind warning in .profile on login in Ubuntu
3Description: Fix bind warning in .profile on login in Ubuntu
4Slug: bind-warning-on-login-in-ubuntu
5Listing: true
6Created: 2020-09-08
7Tags: []
8---
9
10Recently 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.
11
12So 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.
13
14I found a nice alternative that emulates [zsh](http://zsh.sourceforge.net/) like autosuggestion and autocomplete so I added the following to my `.bashrc` file.
15
16```bash
17bind "TAB:menu-complete"
18bind "set show-all-if-ambiguous on"
19bind "set completion-ignore-case on"
20bind "set menu-complete-display-prefix on"
21bind '"\e[Z":menu-complete-backward'
22```
23
24I haven't noticed anything wrong with this and all was working fine until I restarted my machine and then I got this error.
25
26![Profile bind error](/assets/profile-bind-error/error.jpg)
27
28When 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).
29
30So I added a simple `if [ -t 1 ]` around `bind` statements to avoid running commands that presume the session is interactive when it isn't.
31
32```bash
33if [ -t 1 ]; then
34 bind "TAB:menu-complete"
35 bind "set show-all-if-ambiguous on"
36 bind "set completion-ignore-case on"
37 bind "set menu-complete-display-prefix on"
38 bind '"\e[Z":menu-complete-backward'
39fi
40```
41
42After logging out and back in the problem was gone.