Skip to content

Fix config creation during printing - #9353

Merged
kubouch merged 4 commits into
nushell:mainfrom
kubouch:create-config
Jun 4, 2023
Merged

kubouch merged 4 commits into
nushell:mainfrom
kubouch:create-config

Conversation

@kubouch

@kubouch kubouch commented Jun 4, 2023 •

Copy link
Copy Markdown
Contributor

Description

This reverts commit 7f758d3 and re-implements it.

This fixes #9264 without cloning the engine state and using merge_env() by using both the config in permanent state and runtime stack.

Previous solution #9304 required cloning engine state for every print which can get substantial if you have a lot/large values stored in the engine. Also, merge_env() is intended to be used only at the separation between eval and parsing. I hope this approach is cleaner.

This works now

def ctxIssue [] { $env.config.color_config.header = blue; print (ls) }; ctxIssue

User-Facing Changes

Tests + Formatting

After Submitting

@fdncred

fdncred commented Jun 4, 2023

Copy link
Copy Markdown
Contributor

I tested this on MacOS and it seems to work great! Good work @kubouch.

Since I'm going to be out for a week, I'd probably go ahead and land it, but it does need to be tested in Windows with PR 519 in nu_scripts as I described in core-team.

@fdncred

fdncred commented Jun 4, 2023

Copy link
Copy Markdown
Contributor

Before going out the door, I tested this on Windows and it works great! Thanks!

@kubouch
kubouch marked this pull request as ready for review June 4, 2023 19:03
@kubouch
kubouch merged commit 82e6873 into nushell:main Jun 4, 2023
@kubouch
kubouch deleted the create-config branch June 4, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

some theme items do not change colors when requested

2 participants