What is correct value for TERM to ^L=clear-screen on Linux?
Closed this issue · 5 comments
Hello,
Thanks for your efforts porting oksh. Would you happen to know what I should set as the correct value for TERM to ^L=clear-screen on Linux?
I'm on Alpine Linux and ^L does not clear the screen, only enters a newline reprints current input.
This is the same on console with TERM=linux
and in X11 with st(1) and TERM=st-256color
. I checked my OpenBSD VPS and it has TERM=xterm
but that does not seem to work either. I get the same in tmux(1) too.
I have ncurses-terminfo installed, and ncurses provides /usr/bin/clear
which successfully clears the console and terminal so it seems like the console and terminals can clear, they're just not receiving the correct escape strings?
Thanks in advance.
Hmm. No special TERM value should be required. If oksh is linked with ncurses, then ncurses does the work of clearing the screen. If oksh is not linked with ncurses, then ^L just prints a newline. Can you check to make sure your version of oksh is linked with ncurses?
Otherwise I'll need to find time to spin up an Alpine VM and see what's going on.
Ah nope!
$ ldd /bin/oksh
/lib/ld-musl-aarch64.so.1 (0xffff913ee000)
libc.musl-aarch64.so.1 => /lib/ld-musl-aarch64.so.1 (0xffff913ee000)
Alpine has a bit of a thing about removing dependencies...
Built from master:
$ ldd /usr/local/bin/oksh
/lib/ld-musl-aarch64.so.1 (0xffff96557000)
libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0xffff9647d000)
libc.musl-aarch64.so.1 => /lib/ld-musl-aarch64.so.1 (0xffff96557000)
Aaaaaaand.... ^L successfully clears the screen. So this is an Alpine packaging bug.
why does oksh require ncurses for? a replacement for readline?
From the README.md:
Though not required, the ncurses library will be used for screen clearing routines if the library is found during the configure stage. This can be turned off by the user by passing the --disable-curses flag to configure.