Add Vim-like focus history navigation (back/forward)#1863
Open
richard134 wants to merge 2 commits intonikitabobko:mainfrom
Open
Add Vim-like focus history navigation (back/forward)#1863richard134 wants to merge 2 commits intonikitabobko:mainfrom
richard134 wants to merge 2 commits intonikitabobko:mainfrom
Conversation
Implements Vim-like focus history navigation for the focus command, allowing users to navigate back and forward through their focus history similar to Vim's Ctrl-O and Ctrl-I jump list behavior. New commands: - `focus back` - Navigate to the previously focused window - `focus forward` - Navigate forward after going back Key features: - History is automatically recorded when focus changes - Forward history is truncated when focusing a new window (Vim behavior) - Closed windows are automatically skipped - Maximum history size of 100 entries - Incompatible with other focus flags (--boundaries, etc.) Closes nikitabobko#1024
Unify focus-back-and-forth with the focus history stack instead of maintaining a separate _prevFocus variable. This makes the command resilient to closed windows - when the previous window is closed, it will fallback to the next valid window in history. Also seeds the history with the initial focus on first focus change so back-and-forth works immediately after startup. Closes nikitabobko#1024
b52a080 to
364dd1e
Compare
RohanSreelesh
approved these changes
Dec 24, 2025
Davincible
added a commit
to Davincible/AeroSpace
that referenced
this pull request
Feb 11, 2026
…rward) # Conflicts: # Sources/Common/cmdArgs/impl/FocusCmdArgs.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Vim-like focus history navigation (focus back/focus forward) and makes focus-back-and-forth resilient to closed windows by using the shared history stack.
Closes #1024