fish: arrows and backspace keys no longer supported after 11.0-RELEASE upgrade

Polytropon freebsd at
Wed Oct 19 16:30:35 UTC 2016

On Wed, 19 Oct 2016 13:51:42 +0200, David Guyot wrote:
> Hello, there.
> I was using a 10.3-RELEASE FreeBSD with the packaged fish 2.2.0
> installed, without customization, and upgraded my system and packages
> to 11.0-RELEASE. fish were upgraded to 2.3.1, and I lost the previous
> default prompt, but that doesn't really matter. My main problem is that
> it lost support of arrows and backspace keys: whenever I try to use
> them, I get this:
> # Up arrow for autocompletion with the last command
> penegal at Aethelthryth-FreeBSD~/usr/home/penegal> [A
> # Right arrow for autocompletion with the last similar command, then
> # left arrow to correct input
> penegal at Aethelthryth-FreeBSD~/usr/home/penegal> ls[C[D

What you see there is the escape code sequence of those
keys, without the actual escape happening.

The code ^[[A (read: ^[ = escape, [ = left bracket, A)
is the cursor up key; ^[[C and ^[[D are right and left

There has been a regression recently regarding sh not
interpreting escape characters anymore, caused by libedit:

It could be possible that you're seeing something related
to the same origin.

> Tab still functions as usual; 

The tab key sends the ASCII code 9, no escape code.

> backspace produces no result, so I have
> to Ctrl+C to erase the line and restart the typing from the start.

Backspace usually sends ASCII code 8, often abbreviated as ^H

What does

	$ stty -a

show for those control character?

> As I
> also use fish as the root shell, the problem persists when using sudo
> su, but not with su -;

Both "sudo" and "su" (and therefore "sudo su" do not simulate a
full login, while "su -" does that.

> the problem is also present when using fish from
> vt, and the su tweak works all the same.

That's to be expected, because (if I remember correctly) the text
mode consoles now also use the "xterm" emulation.

> bash doesn't have this problem
> and responds as usual to these keys, as do fish over SSH connections,
> so it's not keyboard-related.

I think bash uses ncurses / readline for input processing...

> I suspect a configuration that broke upon the upgrade, but am unsure
> about it, and the fish changelog doen't seem to have anything related,
> but I'm not accustomed to its internals and can have missed it. Does
> somebody have suggestions?

Read the bug report mentioned above. Does this sound reasonable?
Maybe you should also file a bug report or add something to the
existing one.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list