core: don't force shell integration unless we're running that shell#12390
Open
jcollie wants to merge 1 commit intoghostty-org:mainfrom
Open
core: don't force shell integration unless we're running that shell#12390jcollie wants to merge 1 commit intoghostty-org:mainfrom
jcollie wants to merge 1 commit intoghostty-org:mainfrom
Conversation
If you bypassed shell detection and forced a specific shell integration with `shell-integration=<shell>` the `bash` and `nushell` integrations would break commands that were specified with `+new-window -e <command>` (or a similar mechanism) because they modify the command in shell-specific ways and the new command would fail with an "unknown flag" error or similar. This PR fixes that by only permitting shell integration if the command matches the type of shell integration. That means that `shell-integration=nushell` only works if `argv[0]` ends with `nu`, etc. Generally this should not matter unless the shell executable was renamed for some reason and the shell detection failed. Fixes ghostty-org#12378
jparise
requested changes
Apr 23, 2026
Contributor
There was a problem hiding this comment.
I can't look in detail right now (temporarily internet-less), but my initial impression is that this approach isn't quite right.
- The purpose of "forced" shell integration is to ignore the command-based detection, generally for cases when the command is named something else (for reasons we don't know or necessarily need to understand). With the proposed approach, we're basically just using a hinted "detect" path.
- If we don't want shell integration in the
+new-windowpath, I think we should skip callingshell_integration.setup()or pass a somehow different command into it. (This is the part I can't research while on mobile, so sorry if I'm missing something.)
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.
If you bypassed shell detection and forced a specific shell integration with
shell-integration=<shell>thebashandnushellintegrations would break commands that were specified with+new-window -e <command>(or a similar mechanism) because they modify the command in shell-specific ways and the new command would fail with an "unknown flag" error or similar.This PR fixes that by only permitting shell integration if the command matches the type of shell integration. That means that
shell-integration=nushellonly works ifargv[0]ends withnu, etc. Generally this should not matter unless the shell executable was renamed for some reason and the shell detection failed.Fixes #12378