windows如何用Xming处理剪贴板界面?

toiithl6  于 2022-12-05  发布在  Windows
关注(0)|答案(2)|浏览(153)

My question comes from a problem:
I Use Xming on Windows 7 to connect to a Linux host (through PuTTY) in order to start and display a gnome-terminal. I have some troubles using the Windows clipboard:

  • Copy from Windows to Xming works well. (Ctrl-C then middle-click on Xming)
  • Copy from Xming to another Xming cession works with delay. (Selection on Xming then middle-click on the other Xming)
  • Copy from Xming to Windows works most of the time with delay. (Selection on Xming then Ctrl-V on Windows)

On Windows: I have to repeat the Ctrl+V many times before it passed my text. (<10 kBytes)
Note that firsts failing attempts don't past the previous clipboard content.
Note 2: If I use a VB script to paste the clipboard content I have no delay.

Set objHTML = CreateObject("htmlfile")
ClipboardText = objHTML.ParentWindow.ClipboardData.GetData("text")
path = "D:\Users\blanchj1\AppData\Local\Temp\clipboard"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(path, 2, true)
objFile.WriteLine ClipboardText
objFile.Close

Note 3: If I paste through an application menu ex notepad++ -> edit -> paste, I still have this delay.
Note 4: If I paste the content with Ctrl+V a second time, I still have this delay.
Note 5: The delay seems proportional to the number of charters to paste.
So I suppose this delay comes from a windows issue. Is that a problem of characters-encoding conversion?
Who can explain to me how it works?

wwwo4jvm

wwwo4jvm1#

您观察到的延迟与粘贴的字符数成正比应该是意料之中的,因为这些字符中的每一个都必须通过SSH终端(一个串行管道)输入。在您端呈现这些字符需要Windows做一些工作。我猜想,VBScript粘贴操作延迟较少的原因是VBScript粘贴操作在很大程度上消除了过程,因为剪贴板可以处理字符,而不必弄清楚如何绘制它们。

odopli94

odopli942#

当您使用Xming连接到Linux主机并运行图形应用程序时,Xming充当X Window System的客户端,a Window System是Linux的标准图形窗口系统。Xming从Linux主机接收图形输出并将其显示在Windows计算机上。
剪贴板是一种允许您在不同应用程序之间传输文本或其他数据的功能。在X Window系统中,有一个称为“选择”的标准剪贴板,其工作方式与Windows中的剪贴板类似。当您在X Window应用程序中复制文本时,它会自动复制到选择中。然后,当您在另一个X Window应用程序中粘贴文本时,它会自动从所选内容中检索文本。
当您使用Xming在Windows机器上运行Linux图形应用程序时,应用程序对所选内容的使用会自动转换到Windows剪贴板。这允许您使用Windows剪贴板在Linux应用程序和其他Windows应用程序之间传输文本。
从Xming复制到Windows时遇到的延迟很可能是由于将所选内容转换到Windows剪贴板的过程造成的。这种转换可能需要一些时间,特别是当复制的文本很大时。延迟似乎与字符数成正比的事实表明就是这种情况。
延迟的另一个可能原因是Windows使用Xming处理剪贴板界面的方式。Xming可能使用了与Windows预期不同的剪贴板格式,这可能导致Windows必须执行额外的处理来处理剪贴板数据。不过,这只是猜测,需要更多信息来确认。

相关问题