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

GOLPE LIGAÇÃO DE FALSO FUNCIONÁRIO DA CAIXA SOBRE DÍVIDA OU COMPRA NO MERCADO LIVRE

💥💥💥 ALERTA DE GOLPE DO FALSO FUNCIONÁRIO DE BANCO 💥💥💥 Se você receber uma ligação dizendo ser de algum banco como  CAIXA ECONÔMICA FED...