如何从在 putty 中运行的 tmux 复制到 Windows 剪贴板 [英] How to copy from tmux running in putty to windows clipboard
问题描述
ENV:我在 Windows 7 笔记本电脑上用腻子运行 tmux.我在工作时对 linux 系统执行 ssh.
ENV: I am running tmux in putty, on a windows 7 laptop. I do ssh to linux systems while working.
我必须用 tmux 解决两个故障,然后才能将其用于我的所有需求.
I have to solve two glitches with tmux, before using it for all my needs.
我必须将一些文本从 vim 或 tmux 终端复制到 windows 记事本.我为 vim 和 putty 启用了鼠标支持.
I have to copy some text to the windows notepad from vim or the tmux terminal. I have enabled mouse support for both vim and putty.
我尝试了 "*y
和 "+y
但它们都不起作用.如果我使用 putty 的复制能力,那么它也会复制相邻网格的内容.
I have tried "*y
and "+y
but both of them doesn't work. If I use putty's ability for copy then it copies the content of adjacent grids also.
我必须将一些内容从一个窗格中的 vim 文件复制到在另一个窗格中打开的 vim 文件中.是否有任何 vim 技巧.我不想使用 <C-b>[
这样做的方式.
I have to copy some content from vim file in one pane to vim file opened in another pane. Is there any vim trick for this. I don't want to use <C-b>[
way of doing it.
问题 1 更困扰我,因为问题 2 没有问题.
Problem 1 is haunting me more, because there is a w/a for problem 2.
推荐答案
PuTTY 只是一个终端模拟器;Vim 寄存器 *
和 +
关注 X 选择和剪贴板;没有重叠.
PuTTY is just a terminal emulator; the Vim registers *
and +
are concerned about the X selection and clipboard; there's no overlap.
PuTTY 只允许您将选定的终端内容复制到 Windows 剪贴板;当您运行 tmux 时,这将不可避免地包含窗口布局.
PuTTY only allows you to copy the selected terminal contents to the Windows clipboard; when you run tmux, that will inevitably include the window layout.
您需要从 PuTTY 切换到允许真正集成的东西,例如 Cygwin XWin 服务器,这是一个真正的 X 服务器,它集成了 X 剪贴板和 Windows 剪贴板.而不是在 PuTTY 会话中,您可以 ssh -X
进入您的服务器,然后在 Linux 终端中启动 Vim,或直接启动 GVIM.然后,通过 "+y
进行 yanking 将按您的预期工作.
You need to switch from PuTTY to something that allows real integration, like the Cygwin XWin server, which is a real X Server that integrates the X clipboard with the Windows clipboard. Instead of inside the PuTTY session, you'd ssh -X
into your server, and launch Vim in a Linux terminal, or GVIM directly. Then, yanking via "+y
will work as you'd expect.
或者,如果您想继续使用 PuTTY,则必须使用一些解决方法,例如 :write
将选择内容写入本地文件,然后通过 scp 将其传输到 Windows
,例如.
Alternatively, if you want to keep using PuTTY, you'd have to use some workaround, like :write
ing the selection to a local file, and transferring that to Windows via scp
, for instance.
这篇关于如何从在 putty 中运行的 tmux 复制到 Windows 剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!