-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fish_config theme save
returns "Too few arguments"
#9088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme choose xxx` is used, xxx is saved to a hidden global variable `__fish_last_chosen_theme`. If `fish_config theme save` is called without a theme name specified, then this global variable is searched for the name of the last chosen theme and that is saved/persisted as the default theme. Closes fish-shell#9088.
As far as I can tell, the documentation is wrong here because from my reading of At first I thought |
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme save xxx` is used, xxx is loaded w/ its specified colors saved to the according variables in the universal scope. But if `fish_config theme save` is used without a theme's name specified, then the currently specified (known) fish color variables are persisted from whatever scope they're currently in (usually in the global scope from previewing a theme) to universal variables of the same name. This does *not* catch color variables unknown to fish! If a theme and a prompt agree on some variable to hold some color but it's not a color variable known to fish, it won't be persisted! Closes fish-shell#9088.
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme save xxx` is used, xxx is loaded w/ its specified colors saved to the according variables in the universal scope. But if `fish_config theme save` is used without a theme's name specified, then the currently specified (known) fish color variables are persisted from whatever scope they're currently in (usually in the global scope from previewing a theme) to universal variables of the same name. This does *not* catch color variables unknown to fish! If a theme and a prompt agree on some variable to hold some color but it's not a color variable known to fish, it won't be persisted! Closes fish-shell#9088.
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme choose xxx` is used, xxx is saved to a hidden global variable `__fish_last_chosen_theme`. If `fish_config theme save` is called without a theme name specified, then this global variable is searched for the name of the last chosen theme and that is saved/persisted as the default theme. Closes fish-shell#9088.
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme save xxx` is used, xxx is loaded w/ its specified colors saved to the according variables in the universal scope. But if `fish_config theme save` is used without a theme's name specified, then the currently specified (known) fish color variables are persisted from whatever scope they're currently in (usually in the global scope from previewing a theme) to universal variables of the same name. This does *not* catch color variables unknown to fish! If a theme and a prompt agree on some variable to hold some color but it's not a color variable known to fish, it won't be persisted! Closes fish-shell#9088.
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme choose xxx` is used, xxx is saved to a hidden global variable `__fish_last_chosen_theme`. If `fish_config theme save` is called without a theme name specified, then this global variable is searched for the name of the last chosen theme and that is saved/persisted as the default theme. Closes fish-shell#9088.
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme save xxx` is used, xxx is loaded w/ its specified colors saved to the according variables in the universal scope. But if `fish_config theme save` is used without a theme's name specified, then the currently specified (known) fish color variables are persisted from whatever scope they're currently in (usually in the global scope from previewing a theme) to universal variables of the same name. This does *not* catch color variables unknown to fish! If a theme and a prompt agree on some variable to hold some color but it's not a color variable known to fish, it won't be persisted! Closes fish-shell#9088.
The documentation states that running `fish_config theme save` after `fish_config theme choose [theme_name]` will result in "saving" the currently chosen theme, but this does not match the actual behavior of `fish_config theme save` which expects a trailing argument specifying the name of the theme to select/persist. Given that the documented way has been included in a release and that it makes more sense than calling `fish_config theme save xxx` when you are *loading from* xxx and not *saving to* xxx, this patch revises `fish_config.fish` to support the documented behavior. When `fish_config theme save xxx` is used, xxx is loaded w/ its specified colors saved to the according variables in the universal scope. But if `fish_config theme save` is used without a theme's name specified, then the currently specified (known) fish color variables are persisted from whatever scope they're currently in (usually in the global scope from previewing a theme) to universal variables of the same name. This does *not* catch color variables unknown to fish! If a theme and a prompt agree on some variable to hold some color but it's not a color variable known to fish, it won't be persisted! Closes fish-shell#9088.
Fix `fish_config theme save` without trailing theme name. Fixes #9088.
This is fixed for the next release. If we ever do a minor release for 3.5.x we can consider backporting it as well. |
fish 3.5.0 on macOS Big Sur 11.6.7
Basically, I'm following the example from https://fishshell.com/docs/current/faq.html#how-do-i-customize-my-syntax-highlighting-colors
fish_config theme show
worksfish_config theme choose [name_of_theme]
worksfish_config theme save
returns "Too few arguments"The text was updated successfully, but these errors were encountered: