Limit terminal cwd inheritance to terminal windows - #10872
Open
Drecullith wants to merge 1 commit into
Open
Conversation
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.
Summary
Prevent
omarchy-cmd-terminal-cwdfrom inheriting the working directory of an arbitrary shell process owned by the focused application.Previously the helper took the focused window PID, selected one of its child processes, and accepted that child's cwd whenever its executable appeared in
/etc/shells. This meant a non-terminal application such as a browser could accidentally be treated as a terminal if it happened to own a helperbashprocess.For example, a browser download helper running from
~/Downloadscould causeSUPER+ENTERto open a new terminal there even though no terminal window was focused.This change:
hyprctl -j activewindow;terminalHyprland tag as the primary terminal classification, matching the universal clipboard bindings;*;$HOMEbefore inspecting child processes when a non-terminal window is focused;org.wezfurlong.weztermWayland app_id as a compatibility fallback while older terminal rules may not tag it yet.Fixes #10840.
Tests
Added
test/shell.d/terminal-cwd-test.shcovering:terminal*windows inherit cwd;terminalwindows inherit cwd;The focused regression test passes locally, and both changed shell scripts pass Bash syntax validation.