diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2023-12-28 15:36:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 15:36:30 -0800 |
commit | 379eeda57673a07fa744c7fb63c630f5480f7412 (patch) | |
tree | 4dd2202ec971af97603a80b891f0c35636ba97bd /var | |
parent | fc1e0178bf8124dc7a907a68c6f93a28ee685a7f (diff) | |
download | spack-379eeda57673a07fa744c7fb63c630f5480f7412.tar.gz spack-379eeda57673a07fa744c7fb63c630f5480f7412.tar.bz2 spack-379eeda57673a07fa744c7fb63c630f5480f7412.tar.xz spack-379eeda57673a07fa744c7fb63c630f5480f7412.zip |
shell: fix zsh color formatting for PS1 in environments (#39497)
* shell: fix zsh color formatting for PS1 in environments
The `colorize` function in `llnl.util.tty.color` only applies proper formatting for Bash
ANSI and for console output, but this is not what zsh expects for environment variables.
In particular, when using `zsh`, `spack env activate -p` produces a `PS1` prompt that
looks like this:
```
\[\033[0;92m\][ENVIRONMENT]\[\033[0m\]
```
For zsh the formatting should be:
```
\e[0;92m[ENVIRONMENT]\e0;m
```
- [x] Add a `zsh` option to `colorize()` to enable zsh color formatting
- [x] Add conditional to choose the right `PS1` for `zsh`, `bash`, and `sh`
- [x] Don't use color escapes for `sh`, as they don't print properly
* convert lots of += lines to triple quotes
Diffstat (limited to 'var')
0 files changed, 0 insertions, 0 deletions