Skip to content

Fix Television channel parse errors when the user's shell is nushell - #2

Open
nuTTeLLo wants to merge 1 commit into
iurysza:mainfrom
nuTTeLLo:fix/television-nushell-shell
Open

Fix Television channel parse errors when the user's shell is nushell#2
nuTTeLLo wants to merge 1 commit into
iurysza:mainfrom
nuTTeLLo:fix/television-nushell-shell

Conversation

@nuTTeLLo

@nuTTeLLo nuTTeLLo commented Aug 7, 2026

Copy link
Copy Markdown

Problem

Termscope's Television cable channels use POSIX shell syntax:

[source]
command = [
  { name = "Appearance", run = "cat \"$TERMSCOPE_APPEARANCE_CANDIDATES\"" },
  ...
]

[preview]
command = "\"$TERMSCOPE_PYTHON\" \"$TERMSCOPE_SCRIPT\" preview --pane-path \"$TERMSCOPE_PANE_PATH\" {split:\t:0}"

Television runs channel source/preview/action commands through the shell detected from $SHELL on Unix (unless a channel overrides it). For users whose login shell is nushell, the picker's source and preview both break with:

Error: nu::parser::parse_mismatch
x Parse mismatch during operation.
  -[source: 1:21]
1 | "$TERMSCOPE_PYTHON" "$TERMSCOPE_SCRIPT" preview --pane-path "$TERMSCOPE_PANE_PATH" ...
  AAAA
  - expected operator

nushell doesn't parse the POSIX-style $VAR expansion/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.toml and termscope-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 how npm.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 $VAR env expansion.

Testing

Reproduced the nu::parser::parse_mismatch error under nushell, then verified that after adding shell = "bash":

  • the channel TOML still parses and Television still accepts the channel;
  • running the source/preview commands works under bash with the $TERMSCOPE_* env vars set;
  • launching the picker on the cable directory no longer produces a nushell parse error.

Fixes termscoper failing for nushell users.

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.
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.

1 participant