segunda-feira, 15 de março de 2021

Jshell problem with PageUp and PageDown not working on Linux Ubuntu/CentOS

A very common problem in Java Shell Tool (jshell) are the Page-Up and Page-down keyboard keys that do not work properly when accessing through SSH terminal.

When you press page-up key, the terminal show "[1~" characters and when you press page-down key, the terminal show "[4~" characters. 

 This problem happended to me in Linux Ubuntu and Centos distributions, and I believe that it must occur with almost all other distributions. 

TROUBLESHOOTING

1) Temporary solution: 
Change TERM variable to "linux" before start jshell.

$ TERM=linux

$ jshell 
|  Welcome to JShell -- Version 11.0.10
|  For an introduction type: /help intro
jshell>   // Now PgUp and PgDown works. 


2) Permanent solution:
Change TERM variable at terminal startup in ~/.bashrc


 
$ echo "e
xport TERM=linux"  >> ~/.bashrc



Now close your SSH connection, and connect again. 
Show TERM envirounment variable must be "linux"

$ echo $TERM

linux

Start jshell:

 $ jshell 

|  Welcome to JShell -- Version 11.0.10
|  For an introduction type: /help intro
jshell>   // Now PgUp and PgDown works. 


3) Alternative solution:
Use terminal multiplexers like screen or tmux:

$ screen
$ jshell 

|  Welcome to JShell -- Version 11.0.10
|  For an introduction type: /help intro
jshell>   // Now PgUp and PgDown works. 








Nenhum comentário:

Postar um comentário

Atualização DELL INSPIRON 15R com Update para Windows 10 22H2 travado em 61% ou 99%

 Como atualizar notebook DELL INSPIRON 15R com Windows 10 que está com a atualização travada em 61% ou 99%: Processo de atualização manual d...