Skip to content

tstyles update from zsh or bash no longer ends on a PowerShell command - #176

Merged
fcreme merged 1 commit into
mainfrom
fix/update-hint-from-zsh
Nov 20, 2026
Merged

fcreme merged 1 commit into
mainfrom
fix/update-hint-from-zsh

Conversation

@fcreme

@fcreme fcreme commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Reported right after the 0.9.9 release: tstyles update run from zsh ended on

  Open a new tab to use it, or run:
    Import-Module TerminalStyles -Force -DisableNameChecking
PS ~>     Import-Module TerminalStyles -Force -DisableNameChecking
zsh: command not found: Import-Module

Cause. From zsh or bash, tstyles is the function in shell/tstyles.sh, which runs every command in a pwsh of its own through the generated tstyles-cli.ps1. That pwsh exits when the command does, and the next tstyles imports the new version by itself (by name on a Gallery install, by path on a bootstrap install). Both update arms closed on a reload command for a PowerShell session (Import-Module ... -Force, or . $PROFILE for bootstrap) that is neither needed there nor runnable.

Fix. tstyles-cli.ps1 sets $TStylesNoAutoLoad, which the picker and the direct apply already read as "not an interactive pwsh session". The three closing messages in Invoke-TerminalStylesUpdate now read it too:

  • Gallery, updated: "Your next tstyles command uses it."
  • Gallery, version unreadable: keeps "Check with: tstyles help", drops the reload line.
  • Bootstrap: "Update complete. Your next tstyles command uses it."

In a PowerShell session the output is unchanged.

Tests. 6 new cases in tests/Update-SaysWhatChanged.Tests.ps1, each message with the flag set and unset. The 3 zsh cases failed on main with the reported output and pass here. Full local suite: 3949 passed, 0 failed, 23 skipped.

Also: the wiki's Updating page says the same for zsh/bash, and a CHANGELOG entry under Unreleased.

From zsh or bash every tstyles command runs in a one-shot pwsh (the
generated tstyles-cli.ps1, which sets $TStylesNoAutoLoad), and the next
one imports the new version by itself. Both update arms still closed on
'Import-Module TerminalStyles -Force' or '. $PROFILE', which zsh answers
with 'command not found'. Both arms now read the flag and say the next
tstyles command uses the new version.
@fcreme
fcreme merged commit facd409 into main Nov 20, 2026
8 checks passed
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