Repository navigation
tstyles update from zsh or bash no longer ends on a PowerShell command - #176
Merged
Merged
Conversation
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.
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.
Reported right after the 0.9.9 release:
tstyles updaterun from zsh ended onCause. From zsh or bash,
tstylesis the function inshell/tstyles.sh, which runs every command in a pwsh of its own through the generatedtstyles-cli.ps1. That pwsh exits when the command does, and the nexttstylesimports 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. $PROFILEfor bootstrap) that is neither needed there nor runnable.Fix.
tstyles-cli.ps1sets$TStylesNoAutoLoad, which the picker and the direct apply already read as "not an interactive pwsh session". The three closing messages inInvoke-TerminalStylesUpdatenow read it too: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.