I cannot use any console based text editors because my Ctrl+S
is blocked by console output control -- Ctrl+S
normally means stop scrolling under console or terminal, and my screen is eating that key, and not passing to the console based text editors that I'm using (which normally associate with saving the file).
I cannot prove that until I installed dte
today, which has a special mode of
-K Start in a special mode that continuously reads input and prints the name and numeric code of each pressed key.
and here is my output:
$ dte -K
Press any key combination, or use Ctrl+D to exit
C-A 0x1000041
C-A 0x1000041
C-X 0x1000058
C-C 0x1000043
C-D 0x1000044
$ echo $TERM
screen
As we can see that even Ctrl+C
can be passed to text editor, but I've pressed Ctrl+S
(then Ctrl+Q
) many times during this process but they all get eaten by my screen.
How to enable my Ctrl+S
and Ctrl+Q
for console based text editors within screen?
The machine is Debian WSL:
$ uname -rm
4.4.0-19041-Microsoft x86_64
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
UPDATE:
The problem is only under screen
. xterm
or xterm-256color
alone are just fine:
$ dte -K
Press any key combination, or use Ctrl+D to exit
C-X 0x1000058
C-S 0x1000053
C-Q 0x1000051
C-C 0x1000043
C-D 0x1000044
$ echo $TERM
xterm
UPDATE 2:
Confirmed from man screen
that it is indeed screen
causing the problem:
C-a s, (xoff) Send a control-s to the current
C-a C-s; window.
------------------------------------------------------------------------
C-a q, (xon) Send a control-q to the current
C-a C-q window.
and I've found doc about it:
When flow-control is turned off, screen ignores the XON and XOFF characters, which allows the user to send them to the current program by simply typing them (useful for the emacs editor, for instance).
but I haven't found how to turn off flow-control by default to all screen windows.
defflow off
should set flow-control off by default.