在Terminator Terminal Emulator中运行Zsh时,修复.zshrc中的键设置(Home/End/Insert/Delete) [英] Fix key settings (Home/End/Insert/Delete) in .zshrc when running Zsh in Terminator Terminal Emulator
问题描述
我正在运行Ubuntu 11.04.我安装了终结者终端仿真器 0.95和Zsh版本4.3.15.
我在Zsh内的密钥有问题(众所周知).至少这些:
I'm running Ubuntu 11.04. I installed the Terminator Terminal Emulator 0.95, and Zsh, version 4.3.15.
I have (commonly known) problems with my keys inside the Zsh. At least these:
- 首页/结尾,什么也没发生
- 插入/删除/PageUp/PageDown:键入〜"
我已经尝试了.zshrc的一些配置,该配置应该可以解决该问题,但是到目前为止,还没有一种方法真正可行.也许这与Terminator和Zsh的组合有关.我在此页面上进行了2个配置: https://bbs.archlinux.org/viewtopic.php?pid=428669 .
I already tried some configurations for .zshrc which should solve the problem, but no approach really worked so far. Maybe this is related to the combination of Terminator and Zsh. I took the 2 configs on this page: https://bbs.archlinux.org/viewtopic.php?pid=428669.
有人是否具有类似的配置(尤其是Terminator和Zsh),并弄清楚需要在.zshrc中插入哪些内容来修复密钥设置?
Does oneone have a similar configuration (especially Terminator and Zsh) and figured out what needs to be inserted into the .zshrc to fix the key settings?
推荐答案
要知道键的代码,请执行cat
,按该键,然后输入Ctrl + C.
To know the code of a key, execute cat
, press the key, enter and Ctrl+C.
对我来说,Home
发送^[[H
和End
^[[F
,所以我可以将我的.zshrc
放在我的主目录中
For me, Home
sends ^[[H
and End
^[[F
, so i can put i my .zshrc
in my home dir
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
这些代码可能会随您使用的终端仿真器而改变.
These codes could change with the terminal emulator you use.
autoload zkbd ; zkbd
将创建一个包含要使用的键控代码的文件,例如bindkey "${key[Home]}" beginning-of-line
,并且您可以根据终端来获取其他文件.
autoload zkbd ; zkbd
will create a file with an array of keycodes to use, like bindkey "${key[Home]}" beginning-of-line
, and you can source a different file depending on the terminal.
这篇关于在Terminator Terminal Emulator中运行Zsh时,修复.zshrc中的键设置(Home/End/Insert/Delete)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!