-
Notifications
You must be signed in to change notification settings - Fork 9k
Add support for tmux control mode (#3656) #18928
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@microsoft-github-policy-service agree |
|
whoa |
|
This is a long-awaited feature! Thanks @joexue! |
|
FYI: I am working with reduced staffing at the moment, so reviews may be slow to come. I apologize for that. |
|
Is there a nightly build with this PR to test? |
Your best bet is to build this locally. Once it merges, it will be available on the Canary channel though. |
I tried to find the build guide, but couldn't find one. Do you have the link handy? |
README.md ->Developer Guidance @iDarshan |
|
Hi @joexue! Thanks for doing this! I published a build for the team to test internally and we've got a few notes we want to share with you 😊
Overall, this is a really exciting feature and we're excited to see it land! Let us know if you need any guidance or additional comments on any of the thoughts above. 😊 |
Scrollbars are gone is by design, I put the comment in the code, since we want to make local panes size match remote(tmux) panes size, but each split, tmux just lost 1 character to use it as separator, if we have side scrollbars, we cannot make two side's size match. To meet this, the padding size is changed too. As the menu, it is because I tried to touch as less code as I can to do the job. So give the tmux a separate UI system. I described in the PR, this could be improved and should integrated into the present UI/menu system.
I did not see this bug, to help me to reproduce it here, could you describe your env? how do you connect to tmux server? what is the tmux version?
Sure, let me fix it.
Sure, let me look it.
This is by design, remote pane should close by quit it's app. but this is arguable, if we think close local pane should close remote pane too, it is easy and feasible.
Sure. Fair enough.
Please provide the idea, I can try to implement it.
Thanks! Since this PR is a bit big, another option is we split it into two or three parts to make it easy to review and integrate. Such as What do you think, split it or just keep as it is? |
|
@carlos-zamora @DHowett @lhecker @zadjii-msft Thanks |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
54c2bac to
4817698
Compare
|
I have now pushed my changes and would love to hear your opinion. You don't have to filter yourself obviously. I don't believe my changes are technically correct, but I think it works as least as well as it did before. I tried fixing all bugs and issues that I could find and left notes for anything else. |
This comment has been minimized.
This comment has been minimized.
DHowett
left a comment
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.
Review comments for @lhecker - 42/67 files completed!
| </data> | ||
| </root> | ||
| <data name="TmuxControlInfo" xml:space="preserve"> | ||
| <value>Running in tmux control mode; Press 'q' to detach:</value> |
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.
We may need to {Lock...} the word tmux in some of these. We also historically made the q an insert from another resource (so that in German for example the Azure Connection can say "Enter Ja/nein [J/n]"
| const auto newTabClickRevoker = std::move(_newTabClickRevoker); | ||
| auto& page = _page; | ||
|
|
||
| { |
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.
hmm... can you *this={} somehow?
| TerminalOutput.raise(fmt::format(PreviewText, _displayPowerlineGlyphs ? PromptTextPowerline : PromptTextPlain)); | ||
| const auto prompt = _displayPowerlineGlyphs ? PromptTextPowerline : PromptTextPlain; | ||
| const auto text = fmt::format(FMT_COMPILE(PreviewText), prompt); | ||
| TerminalOutput.raise(winrt_wstring_to_array_view(text)); |
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.
well that's unfortunate that one of these functions became throwing
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.
fmt::format can throw though. Marking it as noexcept is akschually technically incorrect. 🤓
| { | ||
| // Do we ever get here (= uninitialized terminal)? If so: How? | ||
| assert(false); | ||
| // Yes, we can get here, when do Pane._Split, it need to call _SetupEntranceAnimation^M |
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.
you have some trailing ^Ms here!
| if (_control) | ||
| { | ||
| _responseBuffer.append(L"\r\n"); | ||
| _control.InjectTextAtCursor(_responseBuffer); |
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.
This should go through the Connection, shouldn't it? If not, document why not
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.
I feel like if we successfully route everything through the connection, we don't need InjectTextAtCursor
but also I understand that we need a way to put the "Press Q" message into the originating control...
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.
This should go through the Connection, shouldn't it? If not, document why not
The connection in this case is the OG tmux one. It's currently in the OSC state and so we can't inject text through the connection. It would just come back to us.
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.
A way I used to consider is using delimiters to distinguish the text goes to tmux or local terminal, but in that case, performance is an issue. That why I used a weird callback to do so.
BTW, I saw a needs-author-feedback label on this PR, I’m not sure if that means me, if so, I’m on a trip, plus I have left the context for long time, please let @lhecker completely take over it. I like your change.👍
|
@joexue Yep, don't worry about the Needs-Author-Feedback. Even if the PR gets automatically closed. As long as you keep your fork up, and your branch open, we prefer to work on your PR like this. That way, you get credit for doing the bulk of the work -- and we can thank you appropriately when it ships. We would literally not have started on this without you. :) |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |

Summary of the Pull Request
Let WT supports tmux control mode
References and Relevant Issues
#3656
Detailed Description of the Pull Request / Additional comments
Support:
Create/attach tmux session
Split pane vertical/horizontal
Window/panes size change
Remove pane/tab if remote pane exit or window exit
Improvements may do:
Tested by using tmux 3.4:
ssh to a machine has tmux or use wsl, then run
"tmux -CC" or "tmux -CC a"
Validation Steps Performed
PR Checklist
tmuxControl Mode #3656