Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

响应ctrl+space问题 #5

Closed
finviman opened this issue Jun 5, 2023 · 10 comments
Closed

响应ctrl+space问题 #5

finviman opened this issue Jun 5, 2023 · 10 comments
Labels
help wanted Extra attention is needed

Comments

@finviman
Copy link

finviman commented Jun 5, 2023

v2ex过来的,今天刚装上,确实好用。有个小问题不知道能不能解决。
windows terminal,默认不能处理ctrl+space按键,比如我tmux prefix设置的这个就无效。查了下是openssh版本问题,windows10默认ssh版本8.1,如果升级到8.9以上,就能解决这个问题,前提是用ssh登录。
如果用tssh,即使ssh版本升级了仍然不行,我看另一issue说是用的go的一个ssh库,没用windows内置的,所以现在我判断是ssh库导致了ctrl+space无效,好像有点棘手了。
试了用其他terminal,比如windterm,执行tssh也有这个问题。

@lonnywong
Copy link
Member

能找到 openssh 8.9 解决的 issue 或代码不?tssh 也应该是有办法解决的,要研究一下。

@finviman
Copy link
Author

finviman commented Jun 5, 2023

microsoft/terminal#4317 这是原始issue,关联到 microsoft/terminal#2865 这里,比较长,我没细看。下面有个人截图说8.9支持,我试了9.x都行。

@lonnywong
Copy link
Member

@FinallyFinancialFreedom 感谢!

我看里面也有人提到了 ctrl + z ,我之前发现在 windows 中 ctrl + z 会变成 stdin 的 EOF 错误,在 trzsz-go 做了一下适配。

tssh 是依赖 trzsz-go 的,也间接解决了 ctrl + z 的问题。

ctrl + space 是个什么样的情况,我可能要到周末才有空深入研究下。

@finviman
Copy link
Author

finviman commented Jun 5, 2023

又试了试,在terminal下,tmux prefix 我映射成 alt+i了,结果登ubuntu好用,登centos无效,如果映射成 ctrl+` ,则反过来,反正试了挺多prefix没有一个能在两个系统都好用的。
如果不用terminal,用其他终端模拟器,又是另一番景象,粗略试了下没精力总结了。

@lonnywong
Copy link
Member

@FinallyFinancialFreedom tmux 默认的快捷键 ctrl + b 是好使的。

@finviman
Copy link
Author

finviman commented Jun 6, 2023

@FinallyFinancialFreedom tmux 默认的快捷键 ctrl + b 是好使的。

ubuntu可以,centos真不行,可能我的问题,因为不用tssh,直接用ssh也不行,但没思路解决了。
我暂时不用tmux了,就terminal+tssh也解决了terminal不能rzsz的问题,够用。

@lonnywong
Copy link
Member

lonnywong commented Jun 6, 2023

https://github.com/PowerShell/openssh-portable/blob/latestw_all/contrib/win32/win32compat/tncon.c
不知道有没有人有空将这个 c 代码用 go 重写出来,可以变成一个 go package,最好不用 cgo (除非能让用户方便地编译安装)。

最好 queue_terminal_window_change_event() 能变成一个 go 回调。

在用 go 重写时,可以参考这个代码:
https://github.com/chzyer/readline/blob/master/rawreader_windows.go

或许 ChatGPT 可以帮忙减轻一部分工作。

@lonnywong lonnywong added the help wanted Extra attention is needed label Jun 6, 2023
@tanqiangyes
Copy link

有人做这个么?没有的话,我空闲的时候可以试试。(ps:最好能有设计文档帮助了解代码)

@lonnywong
Copy link
Member

@tanqiangyes 暂时还没人反馈说在搞这个。

你要有兴趣搞的话,可以加 README 最下面的 QQ 群,然后加群主( 我 )的 QQ,聊一聊要怎么实现。

文档现在没有,主要就是抄 tncon.ctncon.h 这两个文件的代码,用 Go 调 dll 实现。

@lonnywong
Copy link
Member

lonnywong commented Nov 17, 2023

已解决 microsoft/terminal#16298 ,等 Windows Terminal 下个版本发布就支持 Ctrl + Space 了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants