Pane focus is lost after pane swap #22535

Closed
opened 2026-01-31 08:16:04 +00:00 by claunia · 0 comments
Owner

Originally created by @kulkalkul on GitHub (Nov 12, 2024).

Windows Terminal version

1.21.2911.0

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

Create a split pane, use keybinds to swap between them.

Expected Behavior

Pane shouldn't lose focus.

Actual Behavior

Pane loses focus, Terminal doesn't respect any inputs unless the window itself is refocused, here is visual example. I was able to reproduce it with empty $PROFILE (video recording wasn't though):
https://github.com/user-attachments/assets/08cb98dc-72cc-4c23-962e-f909668c184c

Video description:

  • I swap panes twice, lose focus each time, click back to regain focus.
  • I change my active pane to show it works correctly without losing focus.
  • I alt-tab, swap pane again, same behavior.
  • I alt-tab immediately after losing focus, now swapping panes suddenly working without losing focus.
  • I change my active pane.
  • I swap, and now I lose the focus.
  • I do showcase that last one with alt-tab multiple times.

So my uneducated guess is there are two different focuses in play there, usual Windows window focus and Terminal's pane focus. So, clicking on terminal or changing panes via keybind affects pane focus state, which sets the state in a way to cause unexpected behavior. But alt-tabbing it after focus is lost sets that state in a different way (or doesn't set it at all), which allows behavior to work as expected until it is re-set back via clicking or pane change.

Originally created by @kulkalkul on GitHub (Nov 12, 2024). ### Windows Terminal version 1.21.2911.0 ### Windows build number 10.0.22631.0 ### Other Software _No response_ ### Steps to reproduce Create a split pane, use keybinds to swap between them. ### Expected Behavior Pane shouldn't lose focus. ### Actual Behavior Pane loses focus, Terminal doesn't respect any inputs unless the window itself is refocused, here is visual example. I was able to reproduce it with empty $PROFILE (video recording wasn't though): https://github.com/user-attachments/assets/08cb98dc-72cc-4c23-962e-f909668c184c Video description: - I swap panes twice, lose focus each time, click back to regain focus. - I change my active pane to show it works correctly without losing focus. - I alt-tab, swap pane again, same behavior. - I alt-tab immediately after losing focus, now swapping panes suddenly working without losing focus. - I change my active pane. - I swap, and now I lose the focus. - I do showcase that last one with alt-tab multiple times. So my uneducated guess is there are two different focuses in play there, usual Windows window focus and Terminal's pane focus. So, clicking on terminal or changing panes via keybind affects pane focus state, which sets the state in a way to cause unexpected behavior. But alt-tabbing it after focus is lost sets that state in a different way (or doesn't set it at all), which allows behavior to work as expected until it is re-set back via clicking or pane change.
claunia added the Issue-BugNeeds-Tag-FixProduct-TerminalArea-UserInterface labels 2026-01-31 08:16:04 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22535