Skip to content
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

fix: check whether lastFocusedList is valid when assigned #238765

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oxcened
Copy link
Contributor

@oxcened oxcened commented Jan 25, 2025

Fixes #234791

Steps to Reproduce

  1. Open a terminal.
  2. Click on the terminal name button.
  3. Choose "Change color..." and select any color in the modal.
  4. Click on the terminal name button again.
  5. Try "Rename...", "Split terminal", or "Kill terminal."
  6. Notice the buttons don't work.

Issue

The problem happens when you pick a color from the modal. When the color is selected, the modal briefly grabs focus, which triggers an onDidFocus event. This event updates _lastFocusedWidget in listService, which is then mistakenly used in the function getSelectedInstances. The function assumes that lastFocusedList is always a TerminalTabList, which isn't always true.

Fix

The fix ensures listService.lastFocusedList is only used when it's a TerminalTabList, not when other widgets like the QuickInputTree are focused.


Let me know if any adjustments are needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

menu options stop working after terminal's color is changed
2 participants