Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Oct 2016 18:30:25 +0200
From:      Polytropon <freebsd@edvax.de>
To:        David Guyot <david.guyot@europecamions-interactive.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: fish: arrows and backspace keys no longer supported after =?ISO-8859-1?Q?11.0-RELEASE=A0upgrade?=
Message-ID:  <20161019183025.ad55425f.freebsd@edvax.de>
In-Reply-To: <1476877902.1196.27.camel@europecamions-interactive.com>
References:  <1476877902.1196.27.camel@europecamions-interactive.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@Aethelthryth-FreeBSD~/usr/home/penegal> [A
> # Right arrow for autocompletion with the last similar command, then
> # left arrow to correct input
> penegal@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
respectively.

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

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211360

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
(Ctrl-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.



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161019183025.ad55425f.freebsd>