使 Alt + h 切换到 Tmux 中的左窗格

编程入门 行业动态 更新时间:2024-10-26 17:25:45
本文介绍了使 Alt + h 切换到 Tmux 中的左窗格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试让 Alt-h 切换到 Tmux 的左侧窗格.这不起作用:

I'm trying to make Alt-h switch to the left pane in Tmux. This does not work:

bind -n M-h select-pane -L

cat 中按 Alt-h 在我的终端中生成以下输出:

Pressing Alt-h in cat generates the following output in my terminal:

$ cat
^[h

也就是说,看起来 Alt 在我的终端中生成了 ^[.所以,在我的 Tmux 配置中,我也尝试过这种绑定:

That is, it looks like Alt generates ^[ in my terminal. So, in my Tmux configuration, I have also tried this binding:

bind -n ^[h select-pane -L

我已经将 "^[" 既是两个字面的字符串(即 "^" + "["),又是你可以在 Vim 中访问的特殊 "^[" 字符.都不行.

I have made "^[" both a literal two character string (i.e., "^" + "[") as well as the special "^[" character you can access in Vim. Neither work.

如何解决这个问题?

我主要使用 xfce4-terminal 作为我的终端模拟器,但我已经尝试使用 gnome-terminal 和 xterm,但问题仍然存在.

I'm primarily using xfce4-terminal as my terminal emulator, but I've tried using gnome-terminal as well as xterm, and the problem persists.

推荐答案

其实秘密在于你如何输入 ^[ ;-)

Actually the secret is how you enter ^[ ;-)

我假设你想编辑你的 .vimrc

I assume you want to edit your .vimrc

vim ~/.vimrc

导航到正确的位置按ictrl-vctrl-[(在德语键盘上我必须按 ctrl-altgr-8 因为 altgr-8[)

navigate to the correct position press i press ctrl-v press ctrl-[ (on a german keyboard I have to press ctrl-altgr-8 because altgr-8 is [)

之后,您应该生成编写绑定所需的转义序列.

After that you should have the escape sequence generated required to write the binding.

这篇关于使 Alt + h 切换到 Tmux 中的左窗格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 05:07:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390234.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:切换到   窗格   Alt   Tmux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!