无法在 Mac 终端中有效使用 Screen
这篇文章总结了当您的 .zshrc 中有以下内容时在 Mac 终端中使用 Screen 的问题
if [[ $STY = '' ]] then screen -xR; fi
- 解决方案#1 不起作用,但解决方案#2 起作用: 剪贴板程序:pbcopy、pbpaste 和 xsel 根本不起作用
- 在 Mac 中使用时 Vim 中的错误:无法在其中没有分散的窗口由 .Xresources 筛选。
- 已解决: Ctrl A 在终端中停止工作。 这表明屏幕的键盘绑定需要稍微改变。
- 已解决: 使用触摸板滚动不起作用。 通过编辑 .screenrc,回滚可以正常工作(包括触摸板)
- 已解决:无法为屏幕提供 Dvorak 键绑定以在 Scrollback mod 中移动。
- 如何在 Screen 内使用 pbcopy/pbpaste/xsel?
The post summarizes problems in using Screen in Mac's terminal when you have the following in your .zshrc
if [[ $STY = '' ]] then screen -xR; fi
- Solution #1 is not working but Solution #2 works: Clipboard programs: pbcopy, pbpaste and xsel do not work at all
- Bug in Vim when used in Mac: Unable to have no scattered windows in Screen by .Xresources.
- Solved: Ctrl A stops working in terminal. This suggests me that Screen's keyboard bindings need to be changed slightly.
- Solved: The scrolling with touchpad does not work. By editing your .screenrc the scrollback works normally (including touchpad)
- Solved: Unable to have Dvorak keybindings for Screen for moving in Scrollback mod.
- How can you use pbcopy/pbpaste/xsel inside Screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在 screenrc 中:
也适用于 Terminal.app。
In
screenrc
:Works for Terminal.app too.
我通常通过将转义字符设置为 ctrl-z 来解决 ctrl-a 问题(您通常不这样做)当您运行屏幕时不需要经常使用,因为您可以启动一个新屏幕,而不是让进程后台运行)。 在我的
.screenrc
中:使用触摸板滚动是行不通的; screen 充当终端仿真器内的终端仿真器,并且每当您在屏幕之间切换时,screen 都不可能切换 Terminal.app 中的回滚缓冲区。 您将必须使用屏幕的回滚功能。 请参阅本文 有关使用屏幕回滚功能的一些提示。
I usually solve the ctrl-a problem by setting my escape character to ctrl-z (which you generally don't need to use as often when you're running screen, since instead of backgrounding a process, you can just start up a new screen). In my
.screenrc
:Scrolling using the touchpad just isn't going to work; screen is acting as a terminal emulator inside a terminal emulator, and it's just not possible for screen to switch the scrollback buffer in Terminal.app whenever you switch between screens. You're going to have to use screen's scrollback features. See this article for some tips on using screen's scrollback features.
默认的 OS X 终端应用程序很弱。 改为获取 iTerm:
iTerm
如果我没记错的话,iTerm 可以开箱即用地解决所有这些问题(我的install 已有几年历史了,所以我现在无法测试该理论)。
The default OS X Terminal app is weak. Get iTerm instead:
iTerm
If I'm not mistaken, iTerm solves all of these out of the box (my install is a couple years old, so I can't test that theory now).
如果启用备用屏幕缓冲区,问题 #3 可能可以解决。 在
.screenrc
中使用altscreen on
Problem #3 might be solvable if you enable the alternate screen buffer. Use
altscreen on
in.screenrc
解决方案 #1 不起作用
为了能够在 OSX 中复制/粘贴,请将以下内容放入您的 .screenrc
> Th[e] 行 - - 将该文件发送到 pbcopy - -。
该命令绑定到 Ca b(在我的例子中为 Cz b)。
解决方案#2,可以工作,但输入速度相当慢
使用回滚模式,即通过复制粘贴复制模式
解决
该
方案很棒,因为它在所有终端应用程序中都是相同的。 它类似于您使用鼠标时的剪贴板。
Solution #1 which does not work
To be able to copy/paste in OSX put the following to your .screenrc
> Th[e] line - - sends that file to pbcopy - -.
The command is bound to C-a b (in my case, C-z b).
Solution #2 which works but is rather slow to type
Use Scrollback mode i.e. copy mode by
Coping
Pasting
The solution is great, since it is the same in all terminal apps. It is similar to the clipboard as you use with your mouse.
您可以使用 ^A Esc 向上滚动屏幕。 您无法在屏幕中使用触摸板。
You can use ^A Esc to scroll up the screen. You cannot use Touchpad in Screen.
这解决了回滚问题,尽管它有些问题,因为它不知道屏幕的缓冲区。
env TERM=vt100 屏幕
This solves the scrollback issue, although it is somewhat broken in that it isn't aware of screen's buffers.
env TERM=vt100 screen