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