来源:unix.stackexchange.com/questions/1…
You're probably running
shwhich outputs the raw keycodes generated when you press the Up arrow key.A more advanced shell like
bashintercepts these keycodes and does something with them. E.g. show the last command in its history.To fix your issue, type
bashto enter a bash shell. Then use the up/down arrow commands (note, your history would start afresh in the new shell).
总结,换一个命令行shell,如bash。
我使用Ubuntu部署的VS Code Server,默认的命令行工具是sh,不能正常响应键盘的上下左右键。切换到bash后,按下键盘的上下左右键就可以正常响应了。