diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 00b255065..f28392f91 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,11 +1,34 @@ fish 4.3.0 (released ???) ========================= -Notable improvements and fixes ------------------------------- +Color and key binding variables are no longer set in universal scope +-------------------------------------------------------------------- + +- fish no longer sets :ref:`universal variables ` by default. + Specifically, the ``fish_color_*``, ``fish_pager_color_*`` and ``fish_key_bindings`` variables are now set in the global scope by default. + After upgrading to 4.3.0, fish will (once and never again) migrate these universals to globals set at startup in + ``~/.config/fish/conf.d/fish_frozen_theme.fish`` and + ``~/.config/fish/conf.d/fish_frozen_key_bindings.fish``. + We suggest that you delete those files and manage the variables as you please. +- You can still have theme changes propagate to all running shells instantly, + see :ref:`here ` for an example. +- You can still opt into storing color variables in the universal scope + (via the deprecated ``fish_config theme save``) instead, + but that's not recommended because + + 1. it is at odds with dynamic theme switching based on the terminal's color theme (see below). + 2. universal variables as a source of truth are easy to misunderstand, + compared to configuration files like ``config.fish``. + Deprecations and removed features --------------------------------- +- Erasing a color variable (e.g. by running ``set -e fish_color_command``) + no longer prevents fish from overwriting it with the default theme's version. + To set a color to the terminal's default, + set it to an empty list (``set fish_color_command``) or an equivalent (``set fish_color_command normal``). +- ``fish_config theme choose`` now clears only color variables that were set by earlier invocations of a ``fish_config theme choose`` command + (which includes fish's default theme). Interactive improvements ------------------------ @@ -17,6 +40,8 @@ Interactive improvements Improved terminal support ------------------------- +- Themes can now be made color-theme-aware (i.e. light mode vs. dark mode) by including both ``[light]`` and ``[dark]`` sections in the :ref:`theme file `. +- Some default themes have been made color-theme-aware, meaning they dynamically adjust as your terminal's background color switches between light and dark colors (:issue:`11580`). - OSC 133 prompt markers now also mark the prompt end, which improves shell integration with terminals like iTerm2 (:issue:`11837`). - Operating-system-specific key bindings are now decided based on the :ref:`terminal's host OS `. - Focus reporting is enabled unconditionally, not just inside tmux. diff --git a/Cargo.lock b/Cargo.lock index ad9042038..99a927559 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,6 +182,7 @@ dependencies = [ "terminfo", "unix_path", "widestring", + "xterm-color", ] [[package]] @@ -996,6 +997,12 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +[[package]] +name = "xterm-color" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de5f056fb9dc8b7908754867544e26145767187aaac5a98495e88ad7cb8a80f" + [[package]] name = "zerocopy" version = "0.8.27" diff --git a/Cargo.toml b/Cargo.toml index edd41c9ea..69b0ebb74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ rust-embed = { version = "8.9.0", features = [ "include-exclude", "interpolate-folder-path", ] } - serial_test = { version = "3", default-features = false } # We need 0.9.0 specifically for some crash fixes. terminfo = "0.9.0" @@ -62,6 +61,7 @@ widestring = "1.2.0" unicode-segmentation = "1.12.0" unicode-width = "0.2.0" unix_path = "1.0.1" +xterm-color = "1.0.1" [profile.release] overflow-checks = true @@ -101,6 +101,7 @@ pcre2.workspace = true phf = { workspace = true, optional = true } rand.workspace = true terminfo.workspace = true +xterm-color.workspace = true widestring.workspace = true [target.'cfg(not(target_has_atomic = "64"))'.dependencies] diff --git a/doc_src/cmds/fish_config.rst b/doc_src/cmds/fish_config.rst index 1bf9fc9d0..18e60eece 100644 --- a/doc_src/cmds/fish_config.rst +++ b/doc_src/cmds/fish_config.rst @@ -8,7 +8,12 @@ Synopsis fish_config [browse] fish_config prompt (choose | list | save | show) - fish_config theme (choose | demo | dump | list | save | show) + fish_config theme + fish_config theme choose THEME [ --color-theme=(dark | light) ] + fish_config theme demo + fish_config theme dump + fish_config theme list + fish_config theme show [THEME...] Description ----------- @@ -33,14 +38,17 @@ With the ``theme`` command ``fish_config`` can be used to view and choose a them Available subcommands for the ``theme`` command: - ``choose`` loads a theme in the current session. + To override :envvar:`fish_terminal_color_theme`, pass the ``--color-theme`` argument. - ``demo`` displays some sample text in the current theme. - ``dump`` prints the current theme in a loadable format. - ``list`` lists the names of the available themes. -- ``save`` saves the given theme to :ref:`universal variables `. - ``show`` shows what the given themes (or all) would look like. +- *(deprecated, avoid use)* ``save`` saves the given theme to :ref:`universal variables `. The **-h** or **--help** option displays help about using this command. +.. _fish-config-theme-files: + Theme Files ----------- @@ -60,22 +68,36 @@ The format looks like this: :: - # name: 'Cool Beans' - # preferred_background: black + # name: 'My Theme' - fish_color_autosuggestion 666 - fish_color_cancel -r - fish_color_command normal - fish_color_comment '888' '--italics' - fish_color_cwd 0A0 - fish_color_cwd_root A00 - fish_color_end 009900 + [light] + # preferred_background: ffffff + fish_color_normal 000000 + fish_color_autosuggestion 7f7f7f + fish_color_command 0000ee -The two comments at the beginning are the name and background that the web config tool shows. + [dark] + # preferred_background: 000000 + fish_color_normal ffffff + fish_color_autosuggestion 7f7f7f + fish_color_command 5c5cff + + [unknown] + fish_color_normal normal + fish_color_autosuggestion brblack + fish_color_cancel -r + fish_color_command normal + +The comments provide name and background color to the web config tool. + +Themes can have three variants, +one for light mode, +one for dark mode, +and one for terminals that don't :ref:`report colors ` (where :envvar:`fish_terminal_color_theme` is set to ``unknown``). The other lines are just like ``set variable value``, except that no expansions are allowed. Quotes are, but aren't necessary. -Any color variable fish knows about that the theme doesn't set will be set to empty when it is loaded, so the old theme is completely overwritten. +.. _fish_config-color-variables: Other than that, .theme files can contain any variable with a name that matches the regular expression ``'^fish_(?:pager_)?color_.*$'`` - starts with ``fish_``, an optional ``pager_``, then ``color_`` and then anything. diff --git a/doc_src/cmds/fish_hg_prompt.rst b/doc_src/cmds/fish_hg_prompt.rst index 143f5d84b..07b252bc2 100644 --- a/doc_src/cmds/fish_hg_prompt.rst +++ b/doc_src/cmds/fish_hg_prompt.rst @@ -23,7 +23,7 @@ The fish_hg_prompt function displays information about the current Mercurial rep By default, only the current branch is shown because ``hg status`` can be slow on a large repository. You can enable a more informative prompt by setting the variable ``$fish_prompt_hg_show_informative_status``, for example:: - set --universal fish_prompt_hg_show_informative_status + set fish_prompt_hg_show_informative_status If you enabled the informative status, there are numerous customization options, which can be controlled with fish variables. diff --git a/doc_src/cmds/set_color.rst b/doc_src/cmds/set_color.rst index d3736a9a0..586e9bc8a 100644 --- a/doc_src/cmds/set_color.rst +++ b/doc_src/cmds/set_color.rst @@ -57,6 +57,15 @@ The following options are available: **-u** or **--underline**, or **-uSTYLE** or **--underline=STYLE** Set the underline mode; supported styles are **single** (default), **double**, **curly**, **dotted** and **dashed**. +**--theme=THEME** + Ignored. + :ref:`Color variables ` that contain only this option are treated like missing / empty color variables, + i.e. fish will use the fallback color instead. + :doc:`fish_config theme choose ` erases all :ref:`color variable ` + whose value includes this option, and adds this option to all color variables it sets. + This allows identifying variables set by a theme, + and it allows fish to update color variables whenever :envvar:`fish_terminal_color_theme` changes. + **-h** or **--help** Displays help about using this command. diff --git a/doc_src/faq.rst b/doc_src/faq.rst index d5d11d4bd..7a6384f42 100644 --- a/doc_src/faq.rst +++ b/doc_src/faq.rst @@ -129,16 +129,14 @@ If you want to change or disable this display, modify the ``fish_mode_prompt`` f How do I customize my syntax highlighting colors? ------------------------------------------------- -Use the web configuration tool, :doc:`fish_config `, or alter the :ref:`fish_color family of environment variables `. - -You can also use ``fish_config`` on the commandline, like:: +Use the web configuration tool started by :doc:`fish_config `, +or alter the :ref:`fish_color family of environment variables `, +or use the :doc:`fish_config theme ` subcommand, like:: > fish_config theme show # to demonstrate all the colorschemes > fish_config theme choose coolbeans # to load the "coolbeans" theme - > fish_config theme save - # to make the change permanent How do I change the greeting message? ------------------------------------- diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index 5874f1545..f3bbbe6d9 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -73,7 +73,7 @@ Detected errors include: To customize the syntax highlighting, you can set the environment variables listed in the :ref:`Variables for changing highlighting colors ` section. Fish also provides pre-made color themes you can pick with :doc:`fish_config `. -Running just ``fish_config`` opens a browser interface, or you can use ``fish_config theme`` in the terminal. +Running just ``fish_config`` opens a browser interface, or you can use ``fish_config theme`` from fish. For example, to disable nearly all coloring:: @@ -83,6 +83,20 @@ Or, to see all themes, right in your terminal:: fish_config theme show +.. _syntax-highlighting-instant-update: + +To update the theme of all shell sessions without restarting them, +first have those sessions define an :ref:`event handler ` by adding the following to your :ref:`config.fish ` and restarting them:: + + function apply-my-theme --on-variable=my_theme + fish_config theme choose $my_theme + end + +Then, set the corresponding :ref:`universal variable ` from any session:: + + > set -U my_theme lava + > set -U my_theme snow-day + .. _variables-color: Syntax highlighting variables @@ -137,7 +151,8 @@ Variable Meaning ========================================== ===================================================================== -If a variable isn't set or is empty, fish usually tries ``$fish_color_normal``, except for: +If a variable isn't set or is empty after subtracting any ``--theme=THEME`` options, +fish usually tries ``$fish_color_normal``, except for: - ``$fish_color_keyword``, where it tries ``$fish_color_command`` first. - ``$fish_color_option``, where it tries ``$fish_color_param`` first. diff --git a/doc_src/language.rst b/doc_src/language.rst index 95ddf8fcb..d3ae36f81 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -1235,11 +1235,6 @@ If you want to set something in config.fish, or set something in a function and # Set my language set -gx LANG de_DE.UTF-8 -If you want to set some personal customization, universal variables are nice:: - - # Typically you'd run this interactively, fish takes care of keeping it. - set -U fish_color_autosuggestion 555 - Here is an example of local vs function-scoped variables:: function test-scopes @@ -1317,9 +1312,8 @@ This syntax is supported since fish 3.1. Universal Variables ^^^^^^^^^^^^^^^^^^^ -Universal variables are variables that are shared between all the user's fish sessions on the computer. Fish stores many of its configuration options as universal variables. This means that in order to change fish settings, all you have to do is change the variable value once, and it will be automatically updated for all sessions, and preserved across computer reboots and login/logout. - -To see universal variables in action, start two fish sessions side by side, and issue the following command in one of them ``set fish_color_cwd blue``. Since ``fish_color_cwd`` is a universal variable, the color of the current working directory listing in the prompt will instantly change to blue on both terminals. +Universal variables are variables that are shared between all the user's fish sessions on the computer. +All changes to universal variables are persistent and instantly propagated across fish sessions. :ref:`Universal variables ` are stored in the file ``.config/fish/fish_variables``. Do not edit this file directly, as your edits may be overwritten. Edit the variables through fish scripts or by using fish interactively instead. @@ -1691,6 +1685,15 @@ Fish also provides additional information through the values of certain environm the process ID (PID) of the shell. +.. envvar:: fish_terminal_color_theme + + a read-only variable; + set to ``light`` or ``dark`` when the terminal uses a light or dark color theme respectively; + set to ``unknown`` if the terminal does not :ref:`report its colors `. + Like :ref:`status terminal `, this is only populated once the first interactive prompt is shown. + This is used in an :ref:`--on-variable event handler ` to update :ref:`syntax highlighting ` variables whenever the terminal's color theme changes. + See :ref:`here ` for how to specify ``light`` and ``dark`` variants in your theme. + .. envvar:: history a list containing the last commands that were entered. diff --git a/doc_src/terminal-compatibility.rst b/doc_src/terminal-compatibility.rst index d0354f173..767fb4d8c 100644 --- a/doc_src/terminal-compatibility.rst +++ b/doc_src/terminal-compatibility.rst @@ -215,6 +215,14 @@ Optional Commands * - ``\e[?2004l`` - - Disable bracketed paste. + * - ``\e[?2031h`` + - + - Enable unsolicited `color theme reporting `_. + When enabled, the terminal should send ``\e[?997;1n`` or ``\e[?997;2n`` whenever its color theme has changed. + This prompts fish to query for :ref:`background color `. + * - ``\e[?2031l`` + - + - Disable unsolicited color theme reporting. * - .. _term-compat-osc-0: ``\e]0; Pt \e\\`` @@ -234,6 +242,17 @@ Optional Commands - - Create a `hyperlink (OSC 8) `_. This is used in fish's man pages. + * - .. _term-compat-query-background-color: + + ``\e]11;?\e\\`` + - n/a + - Query background color. + + A valid response would be of the form ``\e]11;rgb: Pt / Pt / Pt \e\\`` or ``\e]11;rgba: Pt / Pt / Pt / Pt\e\\`` + where the first three parameters consist of one to four hex digits each, representing red, blue and green components. + + This is used to populate :envvar:`fish_terminal_color_theme`, + which is used to select a :ref:`theme variant ` optimized for the terminal's color theme. * - .. _term-compat-osc-52: ``\e]52;c; Pt \e\\`` diff --git a/po/de.po b/po/de.po index e0c604a48..93a3c4f9a 100644 --- a/po/de.po +++ b/po/de.po @@ -3569,6 +3569,9 @@ msgstr "" msgid "Use the visible width, excluding escape sequences" msgstr "" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "Ausführlicher Modus" diff --git a/po/en.po b/po/en.po index c1cffb99c..2fe606675 100644 --- a/po/en.po +++ b/po/en.po @@ -3567,6 +3567,9 @@ msgstr "Use the portable output format" msgid "Use the visible width, excluding escape sequences" msgstr "" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "Verbose mode" diff --git a/po/fr.po b/po/fr.po index b92a0cce3..1fda25f6a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -3698,6 +3698,9 @@ msgstr "Utiliser le format de sortie portable (POSIX 1003.2)" msgid "Use the visible width, excluding escape sequences" msgstr "" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "Mode verbeux" diff --git a/po/pl.po b/po/pl.po index 6d786c082..d70f1e052 100644 --- a/po/pl.po +++ b/po/pl.po @@ -3563,6 +3563,9 @@ msgstr "" msgid "Use the visible width, excluding escape sequences" msgstr "" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 28c50dcc0..a1f67232d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -3568,6 +3568,9 @@ msgstr "Use the portable output format" msgid "Use the visible width, excluding escape sequences" msgstr "" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "Modo detalhado" diff --git a/po/sv.po b/po/sv.po index 3dea3b6aa..86f178ca4 100644 --- a/po/sv.po +++ b/po/sv.po @@ -3564,6 +3564,9 @@ msgstr "Använd portabelt utdataformat" msgid "Use the visible width, excluding escape sequences" msgstr "" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "Utförligt läge" diff --git a/po/zh_CN.po b/po/zh_CN.po index 6fcab79de..6b06737e7 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -3596,6 +3596,9 @@ msgstr "使用可移植输出格式" msgid "Use the visible width, excluding escape sequences" msgstr "使用可见宽度,不包括转义序列" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "详细模式" diff --git a/po/zh_TW.po b/po/zh_TW.po index d82026813..5d35433d3 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -3571,6 +3571,9 @@ msgstr "使用可攜的輸出格式" msgid "Use the visible width, excluding escape sequences" msgstr "使用可見寬度,排除轉義序列" +msgid "Use this variant, overriding $fish_terminal_color_theme" +msgstr "" + msgid "Verbose mode" msgstr "詳盡模式" diff --git a/share/completions/fish_config.fish b/share/completions/fish_config.fish index 9e7b10138..6310a2035 100644 --- a/share/completions/fish_config.fish +++ b/share/completions/fish_config.fish @@ -16,6 +16,7 @@ complete fish_config -n __fish_use_subcommand -a browse -d 'Open the web-based U complete fish_config -n __fish_use_subcommand -a theme -d 'View and pick from the sample themes' complete fish_config -n '__fish_seen_subcommand_from theme; and __fish_seen_subcommand_from choose save show' -a '(fish_config theme list)' +complete fish_config -n '__fish_seen_subcommand_from theme; and __fish_seen_subcommand_from choose save' -l color-theme -xa 'dark light unknown' -d 'Use this variant, overriding $fish_terminal_color_theme' complete fish_config -n "__fish_seen_subcommand_from theme; and not __fish_seen_subcommand_from $theme_commands" \ -a choose -d 'View and pick from the sample themes' complete fish_config -n "__fish_seen_subcommand_from theme; and not __fish_seen_subcommand_from $theme_commands" \ diff --git a/share/config.fish b/share/config.fish index 2bad0f4bd..a2d000918 100644 --- a/share/config.fish +++ b/share/config.fish @@ -204,6 +204,11 @@ if command -q kill end end +if status is-interactive + __fish_theme_migrate +end +fish_config theme choose default --no-override + # As last part of initialization, source the conf directories. # Implement precedence (User > Admin > Extra (e.g. vendors) > Fish) by basically doing "basename". set -l sourcelist diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index aa057054f..1674cc4a0 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -16,21 +16,9 @@ if status is-interactive # Commands to run in interactive sessions can go here end" >$__fish_config_dir/config.fish - # For one-off upgrades of the fish version - if not set -q __fish_initialized - set -U __fish_initialized 0 - end - set -g __fish_active_key_bindings - # If we are starting up for the first time, set various defaults. - if test $__fish_initialized -lt 3400 - echo yes | fish_config theme save default - set -Ue fish_color_keyword fish_color_option - end - if test $__fish_initialized -lt 3800 && test "$fish_color_search_match[1]" = bryellow - set --universal fish_color_search_match[1] white - end + functions -q __fish_webconfig_update_color_hook # # Generate man page completions if not present. @@ -76,7 +64,8 @@ end" >$__fish_config_dir/config.fish function __fish_reload_key_bindings -d "Reload key bindings when binding variable change" --on-variable fish_key_bindings # Make sure some key bindings are set if not set --query fish_key_bindings - set --universal fish_key_bindings fish_default_key_bindings + set --global fish_key_bindings fish_default_key_bindings + return end # Do nothing if the key bindings didn't actually change. @@ -172,8 +161,4 @@ end" >$__fish_config_dir/config.fish end end __fish_update_cwd_osc # Run once because we might have already inherited a PWD from an old tab - - # Bump this whenever some code below needs to run once when upgrading to a new version. - # The universal variable __fish_initialized is initialized in share/config.fish. - set __fish_initialized 3800 end diff --git a/share/functions/__fish_theme_cat.fish b/share/functions/__fish_theme_cat.fish index 237b10bb8..2a426a7f8 100644 --- a/share/functions/__fish_theme_cat.fish +++ b/share/functions/__fish_theme_cat.fish @@ -6,5 +6,17 @@ function __fish_theme_cat -a theme_name echo >&2 Searched (__fish_theme_dir) "and `status list-files themes`" return 1 end - __fish_data_with_file $theme_path cat + set -l theme_data (__fish_data_with_file $theme_path cat) + set -l allowed_lines \ + '\s*' \ + '\s*#.*' \ + '\[(dark|light|unknown)\]' \ + (__fish_theme_variable_filter) + set allowed_lines "^($(string join -- '|' $allowed_lines))\$" + for line in $theme_data + string match -rq -- $allowed_lines $line + or printf >&2 "error: unsupported line in theme '%s': %s\n" $theme_name $line + end + string join \n $theme_data + true end diff --git a/share/functions/__fish_theme_export_for_webconfig.fish b/share/functions/__fish_theme_export_for_webconfig.fish new file mode 100644 index 000000000..38712d6d3 --- /dev/null +++ b/share/functions/__fish_theme_export_for_webconfig.fish @@ -0,0 +1,40 @@ +# localization: skip(private) + +set -l quote __fish_posix_quote + +function __fish_theme_export_for_webconfig -V quote + $quote "$(fish_config theme dump)" + __fish_theme_for_each __fish_theme_export_for_webconfig_one +end + +function __fish_theme_export_for_webconfig_one -V quote + argparse name= data=+ color-themes=+ -- $argv + or return + set -l name $_flag_name + set -l data $_flag_data + set -l color_themes $_flag_color_themes + set -l pretty_name (string replace -rf -m1 -- '^#\s*name:\s*(.*)' '$1' $data) + set -l url (string replace -rf -m1 -- '^#\s*url:\s*(.*)' '$1' $data) + $quote $name "$pretty_name" "$url" (count $color_themes) + for color_theme in $color_themes + $quote $color_theme + set -l preferred_background + set -l state out + for line in $data + if test $state = out + if test $line = "[$color_theme]" + set state in + end + else + string match -rq -- '^#\s*preferred_background:\s*(?.*)' $line + and break + if string match -rq -- '^\[' $line + break + end + end + end + $quote "$preferred_background" + fish_config theme choose $name --color-theme=$color_theme + $quote "$(fish_config theme dump)" + end +end diff --git a/share/functions/__fish_theme_for_each.fish b/share/functions/__fish_theme_for_each.fish index 7c7acc383..089af816a 100644 --- a/share/functions/__fish_theme_for_each.fish +++ b/share/functions/__fish_theme_for_each.fish @@ -13,8 +13,14 @@ function __fish_theme_for_each end ) set -l theme_data (__fish_theme_cat $theme_name) + set -l color_themes (string split -- \n $theme_data | + string replace -rf -- '^\[(dark|light|unknown)\]$' '$1') + if not set -q color_themes[1] + set color_themes unknown + end $callback \ --name=$theme_name \ - --data=$theme_data + --data=$theme_data \ + --color-themes=$color_themes end end diff --git a/share/functions/__fish_theme_freeze.fish b/share/functions/__fish_theme_freeze.fish new file mode 100644 index 000000000..3bafda209 --- /dev/null +++ b/share/functions/__fish_theme_freeze.fish @@ -0,0 +1,26 @@ +# localization: skip(private) +function __fish_theme_freeze + set -l data_source $argv[1] + set -l theme_data $argv[2..] + set -l relative_path conf.d/fish_frozen_theme.fish + __fish_backup_config_files $relative_path + + set -l help_section interactive#syntax-highlighting + __fish_data_with_file help_sections $(command -v grep) -Fxq $help_section + or echo "fish: internal error: missing help section '$help_section'" + + printf >$__fish_config_dir/$relative_path %s\n \ + $(test $data_source = __fish_theme_migrate && + echo '# This file was created by fish to migrate the default universal variables.') \ + "\ +# Don't edit this, as it will be written by the web-config tool (`fish_config`). +# To customize your theme, delete this file and see +# help $help_section +# or +# man fish-interactive | less +/^SYNTAX.HIGHLIGHTING +# for appropriate commands to add to ~/.config/fish/config.fish instead." \ + $(test $data_source = __fish_theme_migrate && + echo '# See also the release notes for fish 4.3.0 (`help relnotes`).') \ + "" \ + 'set --global '$theme_data +end diff --git a/share/functions/__fish_theme_migrate.fish b/share/functions/__fish_theme_migrate.fish new file mode 100644 index 000000000..76ef546a4 --- /dev/null +++ b/share/functions/__fish_theme_migrate.fish @@ -0,0 +1,131 @@ +# localization: skip(private) +function __fish_theme_migrate + functions -e __fish_theme_migrate + + # Maybe migrate. + if not set -q __fish_initialized || test $__fish_initialized -ge 4300 + return + end + + set -l removing_uvars false + # Copy legacy uvars to globals. + if set -l theme_uvars (__fish_theme_variables --universal) + set removing_uvars true + if not __fish_config_theme_uvars_subset_of_historical_default $theme_uvars + for varname in $theme_uvars + set -g $varname $$varname + end + set -l theme_data + for varname in $theme_uvars + set -a theme_data "$(string escape -- $varname $$varname | string join " ")" + end + __fish_theme_freeze __fish_theme_migrate $theme_data + echo -s (set_color --bold) 'fish:' (set_color normal)' color variables are no longer set in universal scope by default.' + echo "Migrated them to global variables set in $(set_color --underline)$( + __fish_unexpand_tilde $__fish_config_dir/conf.d/fish_frozen_theme.fish + )$(set_color normal)" + end + end + if set -Uq fish_key_bindings + set removing_uvars true + set -l relative_filename conf.d/fish_frozen_key_bindings.fish + set -l filename $__fish_config_dir/$relative_filename + __fish_backup_config_files $relative_filename + echo >$filename "\ +# This file was created by fish to migrate the 'fish_key_bindings' variable +# from its old default scope (universal) to its new default scope (global). +# It is recommended you delete this file and configure key bindings however +# you prefer. + +$( + # No need to freeze the default value. + test "$fish_key_bindings" = fish_default_key_bindings + # Nor if the user has shadowed our previous uvar. + or set -qg fish_key_bindings + and echo "# " +)set --global fish_key_bindings $fish_key_bindings + +# Prior to version 4.3, fish shipped an event handler that runs +# `set --universal fish_key_bindings fish_default_key_bindings` +# whenever the fish_key_bindings variable is erased. +# This means that as long as any fish < 4.3 is still running on this system, +# we cannot complete the migration. +# As a workaround, we erase the universal variable at every shell startup. +set --erase --universal fish_key_bindings" + echo -s (set_color --bold) 'fish:' (set_color normal) ' the fish_key_bindings variable is no longer set in universal scope by default.' + echo -s "Migrated it to a global variable set in " \ + "$(set_color --underline)$(__fish_unexpand_tilde $filename)" \ + (set_color normal) + source $__fish_config_dir/$relative_filename + end + set -U __fish_initialized 4300 + if $removing_uvars + set -Ue fish_key_bindings $theme_uvars + set -l sh (__fish_posix_shell) + $sh -c "sleep 7 # Please read above notice about universal variables" & + end +end + +function __fish_config_theme_matches --no-scope-shadowing + set -l varname $argv[1] + set -l possible_values $argv[2..] + if not set -q possible_values[1] + set possible_values normal "" + end + set -a checked_varnames $varname + not set -q $varname + or contains -- "$$varname" $possible_values +end +function __fish_config_theme_uvars_subset_of_historical_default + set -l checked_varnames + set -l matches __fish_config_theme_matches + $matches fish_color_keyword "$fish_color_command" + and $matches fish_color_option "$fish_color_param" + and $matches fish_color_autosuggestion brblack + and $matches fish_color_cancel -r + and $matches fish_color_command normal blue + and $matches fish_color_comment red + and $matches fish_color_cwd green + and $matches fish_color_cwd_root red + and $matches fish_color_end green + and $matches fish_color_error brred + and $matches fish_color_escape brcyan + and $matches fish_color_history_current --bold + and $matches fish_color_host + and $matches fish_color_host_remote yellow + and $matches fish_color_normal + and $matches fish_color_operator brcyan + and $matches fish_color_param cyan + and $matches fish_color_quote yellow + and $matches fish_color_redirection "cyan --bold" + and $matches fish_color_search_match \ + "bryellow --background=brblack" \ + "bryellow --background=brblack --bold" \ + "white --background=brblack" \ + "white --background=brblack --bold" + and $matches fish_color_selection "white --background=brblack --bold" + and $matches fish_color_status red + and $matches fish_color_user brgreen + and $matches fish_color_valid_path --underline + and $matches fish_color_background + and $matches fish_pager_color_background + and $matches fish_pager_color_completion + and $matches fish_pager_color_description "yellow -i" "yellow --italics" + and $matches fish_pager_color_prefix "normal --bold --underline" + and $matches fish_pager_color_progress \ + "brwhite --background=cyan" \ + "brwhite --background=cyan --bold" + and $matches fish_pager_color_secondary_background + and $matches fish_pager_color_secondary_completion + and $matches fish_pager_color_secondary_description + and $matches fish_pager_color_secondary_prefix + and $matches fish_pager_color_selected_background -r + and $matches fish_pager_color_selected_completion + and $matches fish_pager_color_selected_description + and $matches fish_pager_color_selected_prefix + and for uvar in $argv + contains $uvar $checked_varnames + or test -z "$$uvar" + or return + end +end diff --git a/share/functions/__fish_unexpand_tilde.fish b/share/functions/__fish_unexpand_tilde.fish new file mode 100644 index 000000000..8a724c702 --- /dev/null +++ b/share/functions/__fish_unexpand_tilde.fish @@ -0,0 +1,5 @@ +# localization: skip(private) +function __fish_unexpand_tilde --description 'Replace $HOME with "~"' + set -l realhome (string escape --style=regex -- ~) + string replace -r -- "^$realhome(\$|/)" '~$1' $argv +end diff --git a/share/functions/__fish_webconfig_update_color_hook.fish b/share/functions/__fish_webconfig_update_color_hook.fish new file mode 100644 index 000000000..0187cd3d0 --- /dev/null +++ b/share/functions/__fish_webconfig_update_color_hook.fish @@ -0,0 +1,13 @@ +# localization: skip(private) +function __fish_webconfig_update_color_hook --on-variable __fish_webconfig_theme_notification + if not string match -qr -- '^set-theme-v1-#\d+$' $__fish_webconfig_theme_notification + # Early return for forward compatibility - a future "fish_config" + # may not want to update old shells. + return + end + set -l snippet_file $__fish_config_dir/conf.d/fish_frozen_theme.fish + if not path is $snippet_file + return + end + source $snippet_file +end diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index 21856f0e9..1d903dfba 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -1,5 +1,8 @@ function fish_config --description "Launch fish's web based configuration" - argparse h/help -- $argv + set -l _flag_color_theme + set -l _flag_no_override + + argparse h/help color-theme= no-override -- $argv or return if set -q _flag_help @@ -13,12 +16,32 @@ function fish_config --description "Launch fish's web based configuration" set -q cmd[1] or set cmd browse + if set -q _flag_color_theme[1] + if test $cmd != theme + or not contains -- "$argv[1]" choose save + echo >&2 "fish_config: --color-theme: unknown option" + return 1 + end + if not contains -- $_flag_color_theme dark light unknown + echo >&2 "fish_config theme: --color-theme argument must be one of 'dark', 'light' or 'unknown', got: '$_flag_color_theme'" + return 1 + end + end + if set -q _flag_no_override[1] + if test $cmd != theme + or test "$argv[1]" != choose + echo >&2 "fish_config: --no-override: unknown option" + return 1 + end + end + # The web-based configuration UI # Also opened with just `fish_config` or `fish_config browse`. if test $cmd = browse if set -l python (__fish_anypython) function __fish_config_webconfig -V python -a web_config set -lx __fish_bin_dir $__fish_bin_dir + set -lx __fish_terminal_color_theme $fish_terminal_color_theme $python $web_config/webconfig.py end __fish_data_with_directory tools/web_config '.*' __fish_config_webconfig @@ -182,8 +205,8 @@ function fish_config --description "Launch fish's web based configuration" fish_config theme demo __fish_theme_for_each __fish_config_theme_demo $argv case choose save - __fish_config_theme_choose $cmd $argv - return 0 + __fish_config_theme_choose $cmd $argv --color-theme=$_flag_color_theme $_flag_no_override + return case dump if set -q argv[1] echo "Too many arguments" >&2 @@ -211,9 +234,17 @@ function __fish_config_list_prompts string join \n -- $prompt_paths end +function __fish_config_theme_choose_bad_color_theme -a theme_name desired_color_theme source + echo >&2 "fish_config theme choose: failed to find '[$desired_color_theme]' section (implied by $source) in '$theme_name' theme" +end + function __fish_config_theme_choose set -l cmd $argv[1] set -e argv[1] + set -l _flag_color_theme + set -l _flag_no_override + argparse color-theme= no-override -- $argv + or return if set -q argv[2] echo "Too many arguments" >&2 return 1 @@ -235,13 +266,16 @@ function __fish_config_theme_choose set scope -U end - if not set -q argv[1] + set -l theme_name $argv[1] + set -l desired_color_theme $_flag_color_theme + + # Persist the currently loaded/themed variables (in case of `theme save`). + if not set -q theme_name[1] # We're persisting whatever current colors are loaded (maybe in the global scope) # to the universal scope, without overriding them from a theme file. # Like above, make sure to erase from other scopes first and ensure known color # variables are defined, even if empty. # This branch is only reachable in the case of `theme save` so $scope is always `-U`. - for color in (__fish_theme_variables) # Cache the value from whatever scope currently defines it set -l value $$color @@ -251,29 +285,104 @@ function __fish_config_theme_choose return 0 end - # If we are choosing a theme or saving from a named theme, load the theme now. - # Otherwise, we'll persist the currently loaded/themed variables (in case of `theme save`). - set -l defined_colors - begin - set -l theme_name $argv[1] - __fish_config_theme_canonicalize - __fish_theme_cat $theme_name - or return - end | - string match -r -- (__fish_theme_variable_filter) | - while read -lat toks - # If we're supposed to set universally, remove any shadowing globals - # so the change takes effect immediately (and there's no warning). - if test x"$scope" = x-U; and set -qg $toks[1] - set -eg $toks[1] - end - set $scope $toks - set -a defined_colors $toks[1] + function __fish_apply_theme --on-variable fish_terminal_color_theme \ + -V theme_name -V desired_color_theme -V scope + if set -q __fish_color_theme[1] + set desired_color_theme $__fish_color_theme end + + set -l color_theme + __fish_config_theme_canonicalize + if set -q color_theme[1] && not set -q desired_color_theme[1] + set desired_color_theme $color_theme + end + set -l theme_data (__fish_theme_cat $theme_name) + or return + set -l override (test -n "$__fish_override" && builtin echo true || builtin echo false) + set -l theme_is_color_theme_aware false + set -l color_themes dark light unknown + for ct in $color_themes + if contains -- [$ct] $theme_data + set theme_is_color_theme_aware true + end + end + + if $theme_is_color_theme_aware + if set -q desired_color_theme[1] + if not contains -- "[$desired_color_theme]" $theme_data + __fish_config_theme_choose_bad_color_theme $theme_name "$desired_color_theme" --color-theme=$desired_color_theme + return 1 + end + else + set desired_color_theme $fish_terminal_color_theme + if not set -q desired_color_theme[1] + echo >&2 "fish_config theme choose: internal error: \$fish_terminal_color_theme not yet initialized" + return 1 + end + if not contains -- "[$desired_color_theme]" $theme_data + __fish_config_theme_choose_bad_color_theme $theme_name "$desired_color_theme" \$fish_terminal_color_theme = $desired_color_theme + echo >&2 "fish_config theme choose: hint: if your terminal does not report colors, pass --color-theme=light or --color-theme=dark when using color-theme-aware themes" + return 1 + end + end + else + if set -q desired_color_theme[1] + and test "$desired_color_theme" != unknown + and not contains -- "[$desired_color_theme]" $theme_data + __fish_config_theme_choose_bad_color_theme $theme_name "$desired_color_theme" --color-theme=$desired_color_theme + return 1 + end + end + + set -l color_theme + string join \n -- $theme_data | + while read -lat toks + if $theme_is_color_theme_aware + for ct in $color_themes + if test "$toks" = [$ct] + set color_theme $ct + break + end + end + if test "$color_theme" != $desired_color_theme + continue + end + end + set -l varname $toks[1] + string match -rq -- (__fish_theme_variable_filter) "$varname" + or continue + # If we're supposed to set universally, remove any shadowing globals + # so the change takes effect immediately (and there's no warning). + if test $scope = -U; and set -qg $varname + set -eg $varname + end + if $override || not set -q $varname || string match -rq -- '--theme=.*' $$varname + set $scope $toks --theme=$theme_name + end + end + if $override + for c in (__fish_theme_variables) + string match -rq -- "^--theme=(?!$(string escape --style=regex -- $theme_name)\$).*" $$c + or continue + # Erase conflicting global variables so we don't get a warning and + # so changes are observed immediately. + set -eg $c + set $scope $c + end + end + end + set -l color_theme + __fish_config_theme_canonicalize + if set -q desired_color_theme[1] || set -q color_theme[1] || test -n "$fish_terminal_color_theme" || test $cmd = save + if not set -q _flag_no_override[1] + __fish_override=true __fish_apply_theme + end + end end function __fish_config_theme_canonicalize --no-scope-shadowing # theme_name + # color_theme if not path is (__fish_theme_dir)/$theme_name.theme switch $theme_name case 'fish default' @@ -288,21 +397,36 @@ function __fish_config_theme_canonicalize --no-scope-shadowing set theme_name (string lower (string replace -a " " "-" $theme_name)) end end + switch $theme_name + case \ + ayu-dark ayu-light \ + base16-default-dark base16-default-light \ + solarized-dark solarized-light + string match -rq -- '^(?.*)-(?dark|light)$' $theme_name + case tomorrow + set color_theme light + case tomorrow-night + set theme_name tomorrow + set color_theme dark + end end function __fish_config_theme_demo - argparse name= data=+ -- $argv + argparse name= data=+ color-themes=+ -- $argv or return set -l name $_flag_name + set -l color_themes $_flag_color_themes # Use a new, --no-config, fish to display the theme. set -l fish (status fish-path) $fish --no-config -c ' set -l name $argv[1] - echo -s (set_color normal; set_color --underline) "$name" \ - (set_color normal) - fish_config theme choose $name - fish_config theme demo - ' $name + for color_theme in $argv[2..] + echo -s (set_color normal; set_color --underline) "$name" \ + " ($color_theme color theme)" (set_color normal) + fish_config theme choose $name --color-theme=$color_theme + fish_config theme demo + end + ' $name $color_themes end function __fish_config_prompt_reset diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 93df65cb9..e0144138e 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -26,9 +26,7 @@ function prompt_pwd --description 'short CWD for the prompt' or set -l fish_prompt_pwd_full_dirs 1 for path in $argv - # Replace $HOME with "~" - set -l realhome (string escape --style=regex -- ~) - set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $path) + set -l tmp (__fish_unexpand_tilde $path) if test "$fish_prompt_pwd_dir_length" -eq 0 echo $tmp diff --git a/share/themes/ayu-light.theme b/share/themes/ayu-light.theme deleted file mode 100644 index a4c88d2b0..000000000 --- a/share/themes/ayu-light.theme +++ /dev/null @@ -1,33 +0,0 @@ -# name: ayu Light -# url: https://github.com/dempfi/ayu -# preferred_background: FAFAFA - -fish_color_normal 575F66 -fish_color_autosuggestion 8A9199 -fish_color_cancel -r -fish_color_command 55B4D4 -fish_color_comment ABB0B6 -fish_color_cwd 399EE6 -fish_color_cwd_root red -fish_color_end ED9366 -fish_color_error F51818 -fish_color_escape 4CBF99 -fish_color_history_current --bold -fish_color_host normal -fish_color_host_remote yellow -fish_color_keyword 55B4D4 -fish_color_operator FF9940 -fish_color_option 575F66 -fish_color_param 575F66 -fish_color_quote 86B300 -fish_color_redirection A37ACC -fish_color_search_match --background=FF9940 --bold -fish_color_selection --background=FF9940 --bold -fish_color_status red -fish_color_user brgreen -fish_color_valid_path --underline -fish_pager_color_completion normal -fish_pager_color_description B3A06D yellow -fish_pager_color_prefix normal --bold --underline -fish_pager_color_progress brwhite --background=cyan --bold -fish_pager_color_selected_background --background=FF9940 diff --git a/share/themes/ayu-mirage.theme b/share/themes/ayu-mirage.theme index 1d2929a9c..5c53f722d 100644 --- a/share/themes/ayu-mirage.theme +++ b/share/themes/ayu-mirage.theme @@ -1,7 +1,7 @@ # name: ayu Mirage # url: https://github.com/dempfi/ayu -# preferred_background: 1F2430 +# preferred_background: 1F2430 fish_color_normal CBCCC6 fish_color_autosuggestion 707A8C fish_color_cancel -r diff --git a/share/themes/ayu-dark.theme b/share/themes/ayu.theme similarity index 50% rename from share/themes/ayu-dark.theme rename to share/themes/ayu.theme index 60dfbc8b6..0db4a7142 100644 --- a/share/themes/ayu-dark.theme +++ b/share/themes/ayu.theme @@ -1,7 +1,40 @@ -# name: ayu Dark +# name: ayu # url: https://github.com/dempfi/ayu -# preferred_background: 0A0E14 +[light] +# preferred_background: FAFAFA +fish_color_normal 575F66 +fish_color_autosuggestion 8A9199 +fish_color_cancel -r +fish_color_command 55B4D4 +fish_color_comment ABB0B6 +fish_color_cwd 399EE6 +fish_color_cwd_root red +fish_color_end ED9366 +fish_color_error F51818 +fish_color_escape 4CBF99 +fish_color_history_current --bold +fish_color_host normal +fish_color_host_remote yellow +fish_color_keyword 55B4D4 +fish_color_operator FF9940 +fish_color_option 575F66 +fish_color_param 575F66 +fish_color_quote 86B300 +fish_color_redirection A37ACC +fish_color_search_match --background=FF9940 --bold +fish_color_selection --background=FF9940 --bold +fish_color_status red +fish_color_user brgreen +fish_color_valid_path --underline +fish_pager_color_completion normal +fish_pager_color_description B3A06D yellow +fish_pager_color_prefix normal --bold --underline +fish_pager_color_progress brwhite --background=cyan --bold +fish_pager_color_selected_background --background=FF9940 + +[dark] +# preferred_background: 0A0E14 fish_color_normal B3B1AD fish_color_command 39BAE6 fish_color_quote C2D94C diff --git a/share/themes/base16-default-light.theme b/share/themes/base16-default-light.theme deleted file mode 100644 index a676f1e18..000000000 --- a/share/themes/base16-default-light.theme +++ /dev/null @@ -1,33 +0,0 @@ -# name: Base16 Default Light -# preferred_background: f8f8f8 -# url: https://github.com/chriskempson/base16-default-schemes - -fish_color_normal normal -fish_color_autosuggestion b8b8b8 -fish_color_cancel -r -fish_color_command a1b56c -fish_color_comment f7ca88 -fish_color_cwd green -fish_color_cwd_root red -fish_color_end ba8baf -fish_color_error ab4642 -fish_color_escape 86c1b9 -fish_color_history_current --bold -fish_color_host normal -fish_color_host_remote yellow -fish_color_keyword a1b56c -fish_color_operator 7cafc2 -fish_color_option 383838 -fish_color_param 383838 -fish_color_quote f7ca88 -fish_color_redirection 383838 -fish_color_search_match white --background=brblack --bold -fish_color_selection white --background=brblack --bold -fish_color_status red -fish_color_user brgreen -fish_color_valid_path --underline -fish_pager_color_completion normal -fish_pager_color_description B3A06D yellow -fish_pager_color_prefix normal --bold --underline -fish_pager_color_progress brwhite --background=cyan --bold -fish_pager_color_selected_background --background=brblack diff --git a/share/themes/base16-default-dark.theme b/share/themes/base16-default.theme similarity index 50% rename from share/themes/base16-default-dark.theme rename to share/themes/base16-default.theme index 1b493074b..193d5e56f 100644 --- a/share/themes/base16-default-dark.theme +++ b/share/themes/base16-default.theme @@ -1,7 +1,40 @@ -# name: Base16 Default Dark -# preferred_background: 181818 +# name: Base16 Default # url: https://github.com/chriskempson/base16-default-schemes +[light] +# preferred_background: f8f8f8 +fish_color_normal normal +fish_color_autosuggestion b8b8b8 +fish_color_cancel -r +fish_color_command a1b56c +fish_color_comment f7ca88 +fish_color_cwd green +fish_color_cwd_root red +fish_color_end ba8baf +fish_color_error ab4642 +fish_color_escape 86c1b9 +fish_color_history_current --bold +fish_color_host normal +fish_color_host_remote yellow +fish_color_keyword a1b56c +fish_color_operator 7cafc2 +fish_color_option 383838 +fish_color_param 383838 +fish_color_quote f7ca88 +fish_color_redirection 383838 +fish_color_search_match white --background=brblack --bold +fish_color_selection white --background=brblack --bold +fish_color_status red +fish_color_user brgreen +fish_color_valid_path --underline +fish_pager_color_completion normal +fish_pager_color_description B3A06D yellow +fish_pager_color_prefix normal --bold --underline +fish_pager_color_progress brwhite --background=cyan --bold +fish_pager_color_selected_background --background=brblack + +[dark] +# preferred_background: 181818 fish_color_normal normal fish_color_autosuggestion 585858 fish_color_cancel -r diff --git a/share/themes/default-dark.theme b/share/themes/default-dark.theme deleted file mode 100644 index a74736cb9..000000000 --- a/share/themes/default-dark.theme +++ /dev/null @@ -1,34 +0,0 @@ -# name: fish default (dark mode) -# preferred_background: 000000 - -fish_color_normal ffffff -fish_color_autosuggestion 9f9f9f -fish_color_cancel 000000 --background=ffffff -fish_color_command 5c5cff -fish_color_comment 00cd00 -fish_color_cwd 00ff00 -fish_color_cwd_root 00cd00 -fish_color_end 00ff00 -fish_color_error ff0000 -fish_color_escape 00ffff -fish_color_history_current --bold -fish_color_host ffffff -fish_color_host_remote cdcd00 -fish_color_keyword 5c5cff -fish_color_operator 00ffff -fish_color_option 00cdcd -fish_color_param 00cdcd -fish_color_quote cdcd00 -fish_color_redirection 00cdcd --bold -fish_color_search_match ffffff --bold --background=7f7f7f -fish_color_selection ffffff --bold --background=7f7f7f -fish_color_status 00cd00 -fish_color_user 00ff00 -fish_color_valid_path --underline -fish_pager_color_description cdcd00 --italics -fish_pager_color_prefix ffffff --bold --underline -fish_pager_color_progress ffffff --background=00cdcd --bold -fish_pager_color_selected_background --background=7f7f7f -fish_pager_color_selected_prefix ffffff --bold -fish_pager_color_selected_completion ffffff --bold -fish_pager_color_selected_description ffffff --bold --italics diff --git a/share/themes/default-light.theme b/share/themes/default-light.theme deleted file mode 100644 index 2570f47bb..000000000 --- a/share/themes/default-light.theme +++ /dev/null @@ -1,34 +0,0 @@ -# name: fish default (light mode) -# preferred_background: ffffff - -fish_color_normal 000000 -fish_color_autosuggestion 7f7f7f -fish_color_cancel ffffff --background=000000 -fish_color_command 0000ee -fish_color_comment cd0000 -fish_color_cwd 00cd00 -fish_color_cwd_root cd0000 -fish_color_end 00cd00 -fish_color_error ff0000 -fish_color_escape 00cdcd -fish_color_history_current --bold -fish_color_host 000000 -fish_color_host_remote a0a000 -fish_color_keyword 0000ee -fish_color_operator 00cdcd -fish_color_option 00a0a0 -fish_color_param 00a0a0 -fish_color_quote a0a000 -fish_color_redirection 00a0a0 --bold -fish_color_search_match 060606 --bold --background=cdcdcd -fish_color_selection 060606 --bold --background=cdcdcd -fish_color_status cd0000 -fish_color_user 00cd00 -fish_color_valid_path --underline -fish_pager_color_description a0a000 --italics -fish_pager_color_prefix 000000 --bold --underline -fish_pager_color_progress ffffff --background=00a0a0 --bold -fish_pager_color_selected_background --background=cdcdcd -fish_pager_color_selected_prefix 060606 --bold -fish_pager_color_selected_completion 060606 --bold -fish_pager_color_selected_description 060606 --bold --italics diff --git a/share/themes/default.theme b/share/themes/default.theme index 4a08c0a96..b7cab93d7 100644 --- a/share/themes/default.theme +++ b/share/themes/default.theme @@ -1,5 +1,75 @@ -# name: fish default (16 color palette) +# name: fish default +[light] +# preferred_background: ffffff +fish_color_normal 000000 +fish_color_autosuggestion 7f7f7f +fish_color_cancel ffffff --background=000000 +fish_color_command 0000ee +fish_color_comment cd0000 +fish_color_cwd 00cd00 +fish_color_cwd_root cd0000 +fish_color_end 00cd00 +fish_color_error ff0000 +fish_color_escape 00cdcd +fish_color_history_current --bold +fish_color_host 000000 +fish_color_host_remote a0a000 +fish_color_keyword 0000ee +fish_color_operator 00cdcd +fish_color_option 00a0a0 +fish_color_param 00a0a0 +fish_color_quote a0a000 +fish_color_redirection 00a0a0 --bold +fish_color_search_match 060606 --bold --background=cdcdcd +fish_color_selection 060606 --bold --background=cdcdcd +fish_color_status cd0000 +fish_color_user 00cd00 +fish_color_valid_path --underline +fish_pager_color_description a0a000 --italics +fish_pager_color_prefix 000000 --bold --underline +fish_pager_color_progress ffffff --background=00a0a0 --bold +fish_pager_color_selected_background --background=cdcdcd +fish_pager_color_selected_prefix 060606 --bold +fish_pager_color_selected_completion 060606 --bold +fish_pager_color_selected_description 060606 --bold --italics + +[dark] +# preferred_background: 000000 +fish_color_normal ffffff +fish_color_autosuggestion 9f9f9f +fish_color_cancel 000000 --background=ffffff +fish_color_command 5c5cff +fish_color_comment cd5c5c +fish_color_cwd 00ff00 +fish_color_cwd_root 00cd00 +fish_color_end 00ff00 +fish_color_error ff0000 +fish_color_escape 00ffff +fish_color_history_current --bold +fish_color_host ffffff +fish_color_host_remote cdcd00 +fish_color_keyword 5c5cff +fish_color_operator 00ffff +fish_color_option 00cdcd +fish_color_param 00cdcd +fish_color_quote cdcd00 +fish_color_redirection 00cdcd --bold +fish_color_search_match ffffff --bold --background=7f7f7f +fish_color_selection ffffff --bold --background=7f7f7f +fish_color_status 00cd00 +fish_color_user 00ff00 +fish_color_valid_path --underline +fish_pager_color_description cdcd00 --italics +fish_pager_color_prefix ffffff --bold --underline +fish_pager_color_progress ffffff --background=00cdcd --bold +fish_pager_color_selected_background --background=7f7f7f +fish_pager_color_selected_prefix ffffff --bold +fish_pager_color_selected_completion ffffff --bold +fish_pager_color_selected_description ffffff --bold --italics" + +[unknown] +# 16 color palette fish_color_normal normal fish_color_autosuggestion brblack fish_color_cancel -r diff --git a/share/themes/solarized-light.theme b/share/themes/solarized-light.theme deleted file mode 100644 index 0a4faecc9..000000000 --- a/share/themes/solarized-light.theme +++ /dev/null @@ -1,33 +0,0 @@ -# name: Solarized Light -# preferred_background: fdf6e3 -# url: http://ethanschoonover.com/solarized - -fish_color_normal normal -fish_color_command 586e75 -fish_color_quote 839496 -fish_color_redirection 6c71c4 -fish_color_end 268bd2 -fish_color_error dc322f -fish_color_param 657b83 -fish_color_comment 93a1a1 -fish_color_selection white --background=brblack --bold -fish_color_search_match bryellow --background=white --bold -fish_color_history_current --bold -fish_color_operator 00a6b2 -fish_color_escape 00a6b2 -fish_color_cwd green -fish_color_cwd_root red -fish_color_valid_path --underline -fish_color_autosuggestion 93a1a1 -fish_color_user brgreen -fish_color_host normal -fish_color_cancel -r -fish_pager_color_completion green -fish_pager_color_description B3A06D -fish_pager_color_prefix cyan --underline -fish_pager_color_progress brwhite --background=cyan --bold -fish_pager_color_selected_background --background=white -fish_color_option 657b83 -fish_color_keyword 586e75 -fish_color_host_remote yellow -fish_color_status red diff --git a/share/themes/solarized-dark.theme b/share/themes/solarized.theme similarity index 50% rename from share/themes/solarized-dark.theme rename to share/themes/solarized.theme index 056d55659..10a2e1eeb 100644 --- a/share/themes/solarized-dark.theme +++ b/share/themes/solarized.theme @@ -1,7 +1,40 @@ -# name: Solarized Dark -# preferred_background: 002b36 +# name: Solarized # url: http://ethanschoonover.com/solarized +[light] +# preferred_background: fdf6e3 +fish_color_normal normal +fish_color_command 586e75 +fish_color_quote 839496 +fish_color_redirection 6c71c4 +fish_color_end 268bd2 +fish_color_error dc322f +fish_color_param 657b83 +fish_color_comment 93a1a1 +fish_color_selection white --background=brblack --bold +fish_color_search_match bryellow --background=white --bold +fish_color_history_current --bold +fish_color_operator 00a6b2 +fish_color_escape 00a6b2 +fish_color_cwd green +fish_color_cwd_root red +fish_color_valid_path --underline +fish_color_autosuggestion 93a1a1 +fish_color_user brgreen +fish_color_host normal +fish_color_cancel -r +fish_pager_color_completion green +fish_pager_color_description B3A06D +fish_pager_color_prefix cyan --underline +fish_pager_color_progress brwhite --background=cyan --bold +fish_pager_color_selected_background --background=white +fish_color_option 657b83 +fish_color_keyword 586e75 +fish_color_host_remote yellow +fish_color_status red + +[dark] +# preferred_background: 002b36 fish_color_normal normal fish_color_autosuggestion 586e75 fish_color_cancel -r diff --git a/share/themes/tomorrow-night.theme b/share/themes/tomorrow-night.theme deleted file mode 100644 index 860cc5795..000000000 --- a/share/themes/tomorrow-night.theme +++ /dev/null @@ -1,33 +0,0 @@ -# name: Tomorrow Night -# preferred_background: 232323 -# url: https://github.com/chriskempson/tomorrow-theme - -fish_color_normal normal -fish_color_command b294bb -fish_color_quote b5bd68 -fish_color_redirection 8abeb7 -fish_color_end b294bb -fish_color_error cc6666 -fish_color_param 81a2be -fish_color_comment f0c674 -fish_color_selection white --background=brblack --bold -fish_color_search_match white --background=brblack --bold -fish_color_history_current --bold -fish_color_operator 00a6b2 -fish_color_escape 00a6b2 -fish_color_cwd green -fish_color_cwd_root red -fish_color_valid_path --underline -fish_color_autosuggestion 969896 -fish_color_user brgreen -fish_color_cancel -r -fish_color_host normal -fish_pager_color_completion normal -fish_pager_color_description B3A06D yellow -fish_pager_color_prefix normal --bold --underline -fish_pager_color_progress brwhite --background=cyan --bold -fish_pager_color_selected_background --background=brblack -fish_color_option 81a2be -fish_color_keyword b294bb -fish_color_host_remote yellow -fish_color_status red diff --git a/share/themes/tomorrow.theme b/share/themes/tomorrow.theme index 74be53f1a..aefa36f7c 100644 --- a/share/themes/tomorrow.theme +++ b/share/themes/tomorrow.theme @@ -1,7 +1,8 @@ # name: Tomorrow -# preferred_background: white # url: https://github.com/chriskempson/tomorrow-theme +[light] +# preferred_background: white fish_color_normal normal fish_color_autosuggestion 8e908c fish_color_cancel -r @@ -31,3 +32,35 @@ fish_pager_color_description B3A06D yellow fish_pager_color_prefix normal --bold --underline fish_pager_color_progress brwhite --background=cyan --bold fish_pager_color_selected_background --background=brblack + +[dark] +# preferred_background: 232323 +fish_color_normal normal +fish_color_command b294bb +fish_color_quote b5bd68 +fish_color_redirection 8abeb7 +fish_color_end b294bb +fish_color_error cc6666 +fish_color_param 81a2be +fish_color_comment f0c674 +fish_color_selection white --background=brblack --bold +fish_color_search_match white --background=brblack --bold +fish_color_history_current --bold +fish_color_operator 00a6b2 +fish_color_escape 00a6b2 +fish_color_cwd green +fish_color_cwd_root red +fish_color_valid_path --underline +fish_color_autosuggestion 969896 +fish_color_user brgreen +fish_color_cancel -r +fish_color_host normal +fish_pager_color_completion normal +fish_pager_color_description B3A06D yellow +fish_pager_color_prefix normal --bold --underline +fish_pager_color_progress brwhite --background=cyan --bold +fish_pager_color_selected_background --background=brblack +fish_color_option 81a2be +fish_color_keyword b294bb +fish_color_host_remote yellow +fish_color_status red diff --git a/share/tools/web_config/index.html b/share/tools/web_config/index.html index 2ed400764..dad543097 100644 --- a/share/tools/web_config/index.html +++ b/share/tools/web_config/index.html @@ -36,19 +36,19 @@