Conversation
…viously_ that's gonna blow this diff up.
…s-foreground # Conflicts: # src/host/outputStream.cpp # src/host/outputStream.hpp # src/terminal/adapter/conGetSet.hpp
…h huge parts of console and terminal
…f/11682-vt-focus-events
…988-focus-fg-with-owner
…f/11682-vt-focus-events
This comment was marked as resolved.
This comment was marked as resolved.
lhecker
left a comment
There was a problem hiding this comment.
I can't review this from a architectural POV unfortunately.
…988-focus-fg-with-owner
…f/11682-vt-focus-events
| // it's focused or not, as to match the end-terminal's state. | ||
| // - Used to call ConsoleControl(ConsoleSetForeground,...). | ||
| // - Full support for this sequence is tracked in GH#11682. | ||
| // - Full support for this sequence was added in GH#11682. |
There was a problem hiding this comment.
We can just kill this line. Otherwise we're gonna litter our code with historical artifacts pointing to GitHub issues that we could relegate to git blame :)
| // Theoretically, this could be propagated as a focus event as well, to the | ||
| // input buffer. That should be considered when implementing GH#11682. | ||
|
|
||
| return true; |
There was a problem hiding this comment.
we should make sure that a VT Input client on the far receiving end doesn't get two events each focus change. I was wondering if it would because:
- we might pass one through (original one)
- we add a
FOCUS_EVENTto the input buffer, which TerminalInput later converts into another focus VT sequence
There was a problem hiding this comment.
WHOOPS IT DOES THE OPPOSITE.
Terminal doesn't send any focus events to the client. It sets the terminal into focus mode, it sends the focus in, InteractDispatch then enables CONSOLE_FOREGROUND, and then returns and never writes the focus event to the buffer.
…f/11682-vt-focus-events
…f/11682-vt-focus-events
|
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
I did unmark automerge if you wanted to think about HandleFocusEvent; it's optional of course |
|
🎉 Handy links: |
As described in #13238. libuv sends a focus event to jiggle the handle. Now that we support focus events as VT input (#12900), we'd translate those focus events to VT input as well. That combination of things caused exiting neovim to emit a `\x1b[O` to the input line of the shell when exited. To fix this, we're going to secretly filter out any focus events that came from the API, before translating to VT. We're fortunate here, the `FOCUS_EVENT_RECORD` version of the ctor is only called by the API. * [x] Closes #13238
As described in #13238. libuv sends a focus event to jiggle the handle. Now that we support focus events as VT input (#12900), we'd translate those focus events to VT input as well. That combination of things caused exiting neovim to emit a `\x1b[O` to the input line of the shell when exited. To fix this, we're going to secretly filter out any focus events that came from the API, before translating to VT. We're fortunate here, the `FOCUS_EVENT_RECORD` version of the ctor is only called by the API. * [x] Closes #13238 (cherry picked from commit b22684e) Service-Card-Id: 83027721 Service-Version: 1.14

Further builds on #12799. #12799 assumes that the connection is prepared to receive FocusIn/FocusOut events as input. For ConPTY we can be relatively sure of that, but that's not technically correct. In the hypothetical world where the connection is not a ConPTY connection, then the other side might not be expecting those sequences.
This remedies the issue by
TerminalDispatchandControlCoreare hooked up now to only send focus events when the Terminal is in focus event mode (which will be always for conpty)terminalInput.cppto add support for focus events to conhost as well.checklist
GetConsoleWindow) #2988 as well, but we can do that manually.