Fix Television channel parse errors when the user's shell is nushell - #2
Open
nuTTeLLo wants to merge 1 commit into
Open
Fix Television channel parse errors when the user's shell is nushell#2nuTTeLLo wants to merge 1 commit into
nuTTeLLo wants to merge 1 commit into
Conversation
Termscope's Television channels use POSIX shell syntax
("$TERMSCOPE_PYTHON" "$TERMSCOPE_SCRIPT" preview ...). When $SHELL
is nushell ($SHELL defaults to the login shell on non-shell hosts),
Television executes these commands through nushell, which cannot parse
the POSIX variable-expansion/quoting style, producing:
nu::parser::parse_mismatch x Parse mismatch ... expected operator
Declare shell = "bash" on the [source] and [preview] sections of both
cable channels so the absolute-path/temp-candidate env expansion is
handled by a POSIX shell.
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.
Problem
Termscope's Television cable channels use POSIX shell syntax:
Television runs channel
source/preview/actioncommands through the shell detected from$SHELLon Unix (unless a channel overrides it). For users whose login shell is nushell, the picker's source and preview both break with:nushell doesn't parse the POSIX-style
$VARexpansion/quoting the way a POSIX shell does.Fix
Declare
shell = "bash"on the[source]and[preview]sections of both built-in cable channels (termscope-appearance.tomlandtermscope-alpha.toml). These channels always emit POSIX syntax (they rely on$TERMSCOPE_*env expansion), so they should explicitly request a POSIX shell for the commands they run, matching hownpm.nix-style channels already override the channel shell.This is forward-compatible: bash exists on macOS and Linux (termscope's supported platforms), and the channels already depend on bash-isms in the form of
$VARenv expansion.Testing
Reproduced the
nu::parser::parse_mismatcherror under nushell, then verified that after addingshell = "bash":$TERMSCOPE_*env vars set;Fixes termscoper failing for nushell users.