AIX - 默认 shell - 箭头键

问题描述 投票:0回答:2

我使用的是AIX机器。我有一个担忧。我使用 MobaXterm 访问 AIX 服务器。我希望向上箭头键能给我之前发出的命令。相反,它只是像在某些编辑器中一样上升。使用向下箭头键可以观察到相同的行为。我怎样才能摆脱这种行为?

外壳是ksh。

谢谢。

linux terminal aix
2个回答
2
投票

当终端发送正常模式光标键时,您会看到这种行为。

ksh
可能正在寻找应用程序模式密钥,或者(更有可能)尚未被告知如何处理此问题。您可以使用

让它工作
set -o emacs

但可能还需要建立键绑定(在第一个链接中找到):

#
# 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 "\020"` # up arrow = ^p = back a command
alias __B=`echo "\016"` # down arrow = ^n = down a command
alias __C=`echo "\006"` # right arrow = ^f = forward a character
alias __D=`echo "\002"` # left arrow = ^b = back a character
alias __H=`echo "\001"` # home = ^a = start of line

# Type "set -o emacs" or put this line in your .profile.
set -o emacs

快速检查一下,这对我有用,使用正常模式键。

进一步阅读:


0
投票
  1. $SHELL
    是检查您正在运行的 shell 类型的正确变量。
    $1
    在 shell 脚本中使用,以便检索传递给该脚本的第一个参数。老实说,我不知道为什么要打印
    sh
© www.soinside.com 2019 - 2024. All rights reserved.