mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 01:51:14 -03:00
config.fish: don't load default theme in noninteractive shells
We define colors in noninteractive shells for historical reasons (because colors used to be universal variables). The other potential reason is to get regular syntax highlighting for commands like: fish -c 'read --shell' but if anyone actually uses that they can probably load a theme explicitly. Stop defining colors in noninteractive shells. It's usually not a good idea to make them behave differently from interactive ones, but color seems only relevant for interactive shells? Let's see if anyone complains.. we may end up reverting this if people want to use noninteractive fish to query colors.. but I'm not sure why that would be necessary. Closes #12673
This commit is contained in:
@@ -78,6 +78,7 @@ echo no default universal variables
|
||||
# Labeled color variables may be updated by fish.
|
||||
{
|
||||
$fish -c '
|
||||
fish_config theme choose default
|
||||
set -g fish_color_autosuggestion red
|
||||
set -g fish_color_command green --theme=default
|
||||
__fish_migrate
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# RUN: %fish %s
|
||||
# REQUIRES: command -v diff
|
||||
|
||||
fish_config theme choose default
|
||||
|
||||
set -g fish (status fish-path)
|
||||
|
||||
fish_config prompt list | string match -r '^(?:acidhub|disco|nim)$'
|
||||
|
||||
@@ -299,6 +299,7 @@ functions --no-details --color=never test_color_option
|
||||
# CHECK: echo hello
|
||||
# CHECK: end
|
||||
|
||||
fish_config theme choose default
|
||||
string escape (functions --no-details --color=always test_color_option)
|
||||
# CHECK: function\ \e\[36mtest_color_option\e\[32m
|
||||
# CHECK: \e\[39m\ \ \ \ echo\ \e\[36mhello\e\[32m
|
||||
|
||||
Reference in New Issue
Block a user