[Toybox] Fwd: hexedit uses VT-420 scroll ctrl sequences which dont work on tty1
Jarno Mäkipää
jmakip87 at gmail.com
Mon Sep 23 23:18:20 PDT 2019
Hi
I now tested to run hexedit in tmux: downscroll works but upscroll does not...
Well we might say its tmux fault, but lots of people use tmux nowadays.
And this behavior seemed to be same in framebuffer console and xterms...
On Tue, Sep 24, 2019 at 4:42 AM Rob Landley <rob at landley.net> wrote:
>
>
>
> On 9/23/19 4:02 PM, Jarno Mäkipää wrote:
> > Hey
> >
> > I was looking at how should I limit unchanged lines being rewritten
> > every keypress in vi editor.
> > So I look reference in hexedit and noticed that it does not work
> > properly on virtual terminals
> > (one that open with ctrl+alt+f1...)
> >
> > hexedit seems to use esc[1S and esc[1T for scrolling and found them in here
> >
> > https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
>
> http://man7.org/linux/man-pages/man4/console_codes.4.html
>
> > CSI Ps S Scroll up Ps lines (default = 1) (SU), VT420, ECMA-48.
> > CSI Ps T Scroll down Ps lines (default = 1) (SD), VT420.
> >
> > While most of the time its not really issue, since people run X or
> > have ssh/telnet or serial connection from other device with proper
> > terminal emulator. But in those rare case when you have keyboard and
> > framebuffer console and just messed up that one byte in your file it
> > might come handy to be able fix it.
> >
> > Is there any easy way checking if terminal currently running supports
> > these?
>
> In theory there's the "TERM" environment variable, in practice it's essentially
> useless.
I was looking that most of the terminals set up TERM to be some string
that contains xterm* in it. And linux framebuffer console seems to be
TERM=linux. But then there is exceptions such as stterm that reports
stterm-256color so just searching if TERM contains xterm will not
always work.
>
> > Or should I just ignore and use them anyway, perhaps have :set
> > something to disable them?
>
> I'll see if I can send a patch to Linux to fix the text console. It worked on
> the actual VGA system hardware I tested it on, but my new laptop has a frame
> buffer for the text console and it doesn't work there.
>
> Rob
If you get your patch accepted now, it might take few years until some
hardware vendors have updated their default kernel on their
development board and some unlucky people might run into issues with
this when running latest toybox without updating kernel. And sometimes
they cant update kernel because that hardware vendor provides crummy
binary driver for some interface that they cant rebuild.
But anyway its simple feature and would be nice that Linux has it.
-Jarno
More information about the Toybox
mailing list