Closed amtoine closed 1 month ago
update terminal
uses the osc ansi escapes 10, 11, 12 to change the foreground color, background color, and cursor color in terminals that support it.
update terminal
uses the osc ansi escapes 10, 11, 12 to change the foreground color, background color, and cursor color in terminals that support it.yeah, but when i run the following
source nu-themes/dracula.nu
it immediately changes the theme to Dracula for me
then, the following does not appear to change anything, that's why im not sure i fully understand this command :wink:
use nu-themes/dracula.nu
dracula update terminal
Correct. This is a bug that @NotTheDr01ds has filed. https://github.com/nushell/nushell/issues/13403
@amtoine Perhaps I need to make the README
more clear, but:
Before the change:
Terminal OSC codes were never updated automatically:
use <theme_file>
$env.config.color_config = (<theme>)
That only updated the color_config
, but not the terminal's colors (OSC codes). There was no code, nor instructions in the README
, on how to update the terminal colors. I only found that code in @fdncred's preview
scripts.
After the change:
source
'ing it will update everything (including OSC)use
'ing it will allow the user to set or query elements individually. This provides full backwards compatibility and allows users to have it to still work like it used to, which is what I personally want - I don't want to update my background color when using a new "dark" theme - Most of them change it from deep black to a gray-level.As for this PR - I'm in the process of updating the old themes (manual) so that they work like the updated ones do. While I'm fine with the "old" ones going in temporarily, I'm working on making sure that they don't get lost again by having their generation be part of the make.nu
script.
Correct. This is a bug that ...
Not quite - The behavior that @amtoine describes is correct. If you source
the theme, it's fully activated, then a <theme> update terminal
isn't going to have any effect, because that code was already run when it was source
d.
oooooooh, i understand now @NotTheDr01ds !! i was confused about the background changing color on source :scream:
your explanation is much much clearer, thanks a lot :pray: could you mention this in the README?
set color_config
won't change the background whereas source ...
and update terminal
will (the background is the easiest to see it appears)@amtoine A couple of questions:
README
at the nu_scripts
level, since that's what actually gets installed, right?yup, we can do that, thanks @NotTheDr01ds :pray:
description
this PR puts back a few themes that have been removed in the previous PR and fixes the commands in the README.
a few questions
@NotTheDr01ds, i have a few questions too :)
activate
module? why not directly put theexport-env
in the module?update terminal
command, what does it do?