无法在 Mac 终端中有效使用 Screen

发布于 2024-07-18 15:53:56 字数 1231 浏览 4 评论 0原文

这篇文章总结了当您的 .zshrc 中有以下内容时在 Mac 终端中使用 Screen 的问题

if [[ $STY = '' ]] then screen -xR; fi 
  1. 解决方案#1 不起作用,但解决方案#2 起作用: 剪贴板程序:pbcopy、pbpaste 和 xsel 根本不起作用
  2. 在 Mac 中使用时 Vim 中的错误:无法在其中没有分散的窗口由 .Xresources 筛选。
  3. 已解决 Ctrl A 在终端中停止工作。 这表明屏幕的键盘绑定需要稍微改变。
  4. 已解决 使用触摸板滚动不起作用。 通过编辑 .screenrc,回滚可以正常工作(包括触摸板)
  5. 已解决:无法为屏幕提供 Dvorak 键绑定以在 Scrollback mod 中移动。
  6. 如何在 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 
  1. Solution #1 is not working but Solution #2 works: Clipboard programs: pbcopy, pbpaste and xsel do not work at all
  2. Bug in Vim when used in Mac: Unable to have no scattered windows in Screen by .Xresources.
  3. Solved: Ctrl A stops working in terminal. This suggests me that Screen's keyboard bindings need to be changed slightly.
  4. Solved: The scrolling with touchpad does not work. By editing your .screenrc the scrollback works normally (including touchpad)
  5. Solved: Unable to have Dvorak keybindings for Screen for moving in Scrollback mod.
  6. How can you use pbcopy/pbpaste/xsel inside Screen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

久而酒知 2024-07-25 15:53:56

在 screenrc 中:

# Make xterm scrolling work properly with screen.
termcapinfo xterm-256color|xterm-color|xterm|xterms|xs|rxvt ti@:te@

也适用于 Terminal.app。

In screenrc:

# Make xterm scrolling work properly with screen.
termcapinfo xterm-256color|xterm-color|xterm|xterms|xs|rxvt ti@:te@

Works for Terminal.app too.

赴月观长安 2024-07-25 15:53:56

我通常通过将转义字符设置为 ctrl-z 来解决 ctrl-a 问题(您通常不这样做)当您运行屏幕时不需要经常使用,因为您可以启动一个新屏幕,而不是让进程后台运行)。 在我的 .screenrc 中:

escape ^Zz

使用触摸板滚动是行不通的; 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:

escape ^Zz

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.

小傻瓜 2024-07-25 15:53:56

默认的 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).

初心 2024-07-25 15:53:56

如果启用备用屏幕缓冲区,问题 #3 可能可以解决。 在 .screenrc 中使用 altscreen on

Problem #3 might be solvable if you enable the alternate screen buffer. Use altscreen on in .screenrc

扎心 2024-07-25 15:53:56

解决方案 #1 不起作用

为了能够在 OSX 中复制/粘贴,请将以下内容放入您的 .screenrc

bind b eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"

> Th[e] 行 - - 将该文件发送到 pbcopy - -。

该命令绑定到 Ca b(在我的例子中为 Cz b)。

解决方案#2,可以工作,但输入速度相当慢

使用回滚模式,即通过复制粘贴复制模式

解决

C-A [

C-A ]

方案很棒,因为它在所有终端应用程序中都是相同的。 它类似于您使用鼠标时的剪贴板。

Solution #1 which does not work

To be able to copy/paste in OSX put the following to your .screenrc

bind b eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"

> 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

C-A [

Pasting

C-A ]

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.

小巷里的女流氓 2024-07-25 15:53:56

Q5:不可能:滚动
触摸板不起作用。

您可以使用 ^A Esc 向上滚动屏幕。 您无法在屏幕中使用触摸板。

Q5: Impossible: The scrolling with
touchpad does not work.

You can use ^A Esc to scroll up the screen. You cannot use Touchpad in Screen.

北方的韩爷 2024-07-25 15:53:56

这解决了回滚问题,尽管它有些问题,因为它不知道屏幕的缓冲区。
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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文