1

When I connect to my Docker container with Debian 11 via ssh, I have it set up such that zsh is the main shell. When I switch to bash (by typing bash) I lose the ability to type the lowercase letter s (no such problem with any other letter, lower or uppercase, even UTF-8 and other, non-latin alphabets, work).

It is the same if I connect via docker attach CONTAINER_NAME (because then, bash is the default shell, not zsh). This problem persists across various terminal applications and regardless of whether I connect as root or another user.

The locales are all configured as en_US.UTF-8

The issue appears to be in stty or .inputrc, I suspect, and a tried variations of settings of each, yet no matter what I try, nothing seems to make any difference (I double check and reboot the container every time).

Furthermore, it appears that upon loading a Python 3.11 console which is started by one of the python cli-apps run from under zsh (not bash!), I also cannot type the lowercase letter s there. More interestingly, while in bash I can at least paste it, Python console simply refuses to even accept it pasted, basically stripping all letters s.

Below are my .inputrc settings:

"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on

Settings ensuring certain typed ASCII charachters are printing

set output-meta on set input-meta on set convert-meta off

FIY: commenting them all out didn't help, as well as setting the same settings in /etc/inputrc. And here's the current stty settings (set to stty sane, but I tried various different kinds):

$ stty --all
speed 38400 baud; rows 43; columns 170; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc 

And, just in case the output of locale command (ran when in bash):

$ locale
LANG=en_US.UTF-8
LANGUAGE=en.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

The the contents of the global /etc/inputrc is this:

$ cat /etc/inputrc 
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.

Be 8 bit clean.

set input-meta on set output-meta on

To allow the use of 8bit-characters like the german umlauts, uncomment

the line below. However this makes the meta key not work as a meta key,

which is annoying to those which don't need to type in 8-bit characters.

set convert-meta off

try to enable the application keypad when it is called. Some systems

need this to enable the arrow keys.

set enable-keypad on

see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys

do not bell on tab-completion

set bell-style none

set bell-style visible

some defaults / modifications for the emacs mode

$if mode=emacs

allow the use of the Home/End keys

"\e[1~": beginning-of-line "\e[4~": end-of-line

allow the use of the Delete/Insert keys

"\e[3~": delete-char "\e[2~": quoted-insert

mappings for "page up" and "page down" to step to the beginning/end

of the history

"\e[5~": beginning-of-history

"\e[6~": end-of-history

alternate mappings for "page up" and "page down" to search the history

"\e[5~": history-search-backward

"\e[6~": history-search-forward

mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving

"\e[1;5C": forward-word "\e[1;5D": backward-word "\e[5C": forward-word "\e[5D": backward-word "\e\e[C": forward-word "\e\e[D": backward-word

#$if term=rxvt #"\e[7~": beginning-of-line #"\e[8~": end-of-line #"\eOc": forward-word #"\eOd": backward-word #$endif

for non RH/Debian xterm, can't hurt for RH/Debian xterm

"\eOH": beginning-of-line

"\eOF": end-of-line

for freebsd console

"\e[H": beginning-of-line

"\e[F": end-of-line

$endif

I think I never cared much about it until I had to work with the Python console, and I believe this is somehow connected.

Can anyone advise?

UPDATE: while bind '"s": self-insert' helped with the bash itself, the python console still refuses to type or accept lower case letter s, regardless of whether it's being launched from zsh or from bash after running the suggested command. Also, the suggested bind command prints quite a few similar warnings when added to .bashrc, the warnings are this:

bind: warning: line editing not enabled

I mitigated this by redirecting STDERR to /dev/null, but the root cause of the problem seems to be unsolved.

orion3
  • 722

0 Answers0