AIX - 默认 shell - 方向键
AIX - Default shell - Arrow keys
我正在使用 AIX 机器。我有一个顾虑。我使用 MobaXterm 访问 AIX 服务器。我希望向上箭头键给我之前发出的命令。相反,它只是像在某些编辑器中那样上升。使用向下箭头键观察到相同的行为。我怎样才能摆脱这种行为?
shell是ksh。
谢谢。
$SHELL
是检查你 shell 属于哪种 运行 的正确变量。 </code> 在 shell 脚本中使用,以检索您传递给该脚本的第一个参数。老实说,我不知道为什么要打印 <code>sh
。
当终端发送正常模式光标键时,您会看到这种行为。 ksh
可能正在寻找应用程序模式密钥,或者(更有可能)尚未被告知如何处理此问题。您可以使用
让它工作
set -o emacs
但可能还需要建立键绑定(在第一个 link 中找到):
#
# The ksh has an undocumented way of binding the arrow keys to the emacs
# line editing commands. In your .kshrc or in your .profile, add:
alias __A=`echo "0"` # up arrow = ^p = back a command
alias __B=`echo "6"` # down arrow = ^n = down a command
alias __C=`echo "[=11=]6"` # right arrow = ^f = forward a character
alias __D=`echo "[=11=]2"` # left arrow = ^b = back a character
alias __H=`echo "[=11=]1"` # home = ^a = start of line
# Type "set -o emacs" or put this line in your .profile.
set -o emacs
快速检查一下,这对我有用,使用普通模式键。
进一步阅读:
- aixterm and arrow keys - AIX
- AIX : retrieving previous command using up arrow
- Make Arrow and delete keys work in KornShell command line
- My cursor keys do not work(ncurses 常见问题解答)
我正在使用 AIX 机器。我有一个顾虑。我使用 MobaXterm 访问 AIX 服务器。我希望向上箭头键给我之前发出的命令。相反,它只是像在某些编辑器中那样上升。使用向下箭头键观察到相同的行为。我怎样才能摆脱这种行为?
shell是ksh。
谢谢。
$SHELL
是检查你 shell 属于哪种 运行 的正确变量。</code> 在 shell 脚本中使用,以检索您传递给该脚本的第一个参数。老实说,我不知道为什么要打印 <code>sh
。
当终端发送正常模式光标键时,您会看到这种行为。 ksh
可能正在寻找应用程序模式密钥,或者(更有可能)尚未被告知如何处理此问题。您可以使用
set -o emacs
但可能还需要建立键绑定(在第一个 link 中找到):
#
# The ksh has an undocumented way of binding the arrow keys to the emacs
# line editing commands. In your .kshrc or in your .profile, add:
alias __A=`echo "0"` # up arrow = ^p = back a command
alias __B=`echo "6"` # down arrow = ^n = down a command
alias __C=`echo "[=11=]6"` # right arrow = ^f = forward a character
alias __D=`echo "[=11=]2"` # left arrow = ^b = back a character
alias __H=`echo "[=11=]1"` # home = ^a = start of line
# Type "set -o emacs" or put this line in your .profile.
set -o emacs
快速检查一下,这对我有用,使用普通模式键。
进一步阅读:
- aixterm and arrow keys - AIX
- AIX : retrieving previous command using up arrow
- Make Arrow and delete keys work in KornShell command line
- My cursor keys do not work(ncurses 常见问题解答)