-
Notifications
You must be signed in to change notification settings - Fork 236
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
Terminal: Catch change directory signal in node-pty, rename terminal buffer and change Emacs default-directory variable real-time #325
Conversation
注意indentation,我把之前的改过来了导致这儿出现conflict,你也改一下。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
粗略的看了一下,还没时间测试
…buffer and change Emacs default-directory variable real-time
71b0318
to
14f1639
Compare
感谢Review, 已经按相关要求更新。 另外我在JS中多增加了一个判断,避免了切换到"/"根目录时显示“//”的情况 |
基本没有问题,可以试着支持一下ssh 你感兴趣的话可以再增加一个功能,当terminal正在跑一段程序的时候,buffer-name改成: 程序名 - |
可以尝试。
我看了一下,服务器端如果执行程序的话,并不会发送特别的消息到前端,要实现这个可能需要换一种思路。 |
我想到了,可以首先储存按下的按键信息,在前端按下回车后,进入跑程序状态,当收到下面命令后自动退出跑程序状态。那这也可以尝试。
|
哈哈,一种问题有很多种解法,随便尝试随便玩 |
fix bug in #325 change request.
When you change the directory, sever sends a mesage to the front-end. Here is an example of the message sent when you change your directory into
~
:�]0;hollowman@hollow-manjaro:~��[01;32m[hollowman@hollow-manjaro�[01;37m ~�[01;32m]$
So I use regular expression
/:([^\x07].*?)\x07/g
to extract the directory infomation when that signal occurs and store it in variabletitle
.AppBuffer
(Buffer.py) keep checking thetitle
variable every 250ms, if it detects any change,on_change_directory
method will set the title and Emacs default directory.