[PR #13260] [MERGED] Filter focus events that came from the API #29448

Open
opened 2026-01-31 09:34:58 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13260
Author: @zadjii-msft
Created: 6/9/2022
Status: Merged
Merged: 6/10/2022
Merged by: @undefined

Base: mainHead: dev/migrie/b/13238-focus-nvim


📝 Commits (7)

  • f6bba6a not the bodgiest code I've shipped today
  • 9619db0 Coulda swore this was in here already
  • 5f4a478 Merge remote-tracking branch 'origin/main' into dev/migrie/b/13238-focus-nvim
  • cbdbdbb you caught me writing python
  • 3afca07 tests too
  • 0598115 const considered harmful
  • eb3de65 Update src/terminal/adapter/ut_adapter/inputTest.cpp

📊 Changes

5 files changed (+90 additions, -6 deletions)

View changed files

📝 .github/actions/spelling/allow/allow.txt (+1 -0)
📝 src/terminal/adapter/ut_adapter/inputTest.cpp (+57 -4)
📝 src/terminal/input/terminalInput.cpp (+8 -0)
📝 src/types/FocusEvent.cpp (+13 -0)
📝 src/types/inc/IInputEvent.hpp (+11 -2)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13260 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 6/9/2022 **Status:** ✅ Merged **Merged:** 6/10/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/13238-focus-nvim` --- ### 📝 Commits (7) - [`f6bba6a`](https://github.com/microsoft/terminal/commit/f6bba6a7bc905d8a46fc7fee511767274d84d41b) not the bodgiest code I've shipped today - [`9619db0`](https://github.com/microsoft/terminal/commit/9619db08eb77589e9b918f9606af55ddef191dd5) Coulda swore this was in here already - [`5f4a478`](https://github.com/microsoft/terminal/commit/5f4a478115605af94512a4f1576ca9a5897bde58) Merge remote-tracking branch 'origin/main' into dev/migrie/b/13238-focus-nvim - [`cbdbdbb`](https://github.com/microsoft/terminal/commit/cbdbdbb9bf948a556462928e8e44a468cb1780fb) you caught me writing python - [`3afca07`](https://github.com/microsoft/terminal/commit/3afca07a62818afc7e22ba4a6065088c7dccb703) tests too - [`0598115`](https://github.com/microsoft/terminal/commit/05981158049298a2f56a0e449f016639d6b025f1) const considered harmful - [`eb3de65`](https://github.com/microsoft/terminal/commit/eb3de65500b526e2ad2c7fdee278845e44f513a5) Update src/terminal/adapter/ut_adapter/inputTest.cpp ### 📊 Changes **5 files changed** (+90 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/allow.txt` (+1 -0) 📝 `src/terminal/adapter/ut_adapter/inputTest.cpp` (+57 -4) 📝 `src/terminal/input/terminalInput.cpp` (+8 -0) 📝 `src/types/FocusEvent.cpp` (+13 -0) 📝 `src/types/inc/IInputEvent.hpp` (+11 -2) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:34:58 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29448