Skip to content
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

Inconsistent runtime interpretation of $env.config by internal commands (help, errors output) #12746

Open
39555 opened this issue May 3, 2024 · 0 comments
Labels
needs-triage An issue that hasn't had any proper look

Comments

@39555
Copy link

39555 commented May 3, 2024

Describe the bug

For certain internal commands (such as help and error output) Newly assigned $env.config options within the same script/statement will be updated lazily.

These options will only take effect for the next command in the interactive session. In the --commands mode and scripts nu test.nu they will not affect the entire command/script.

For other internal commands such asls changes in $env.config will be visible immediately.

How to reproduce

  1. with help
nu -c "$env.config.use_ansi_coloring = false ; help ls"
# this works
nu -c "$env.config.use_ansi_coloring = false ; ls"

Interactive session:

$env.config.use_ansi_coloring = false ; help ls # Here help still contains ansi

help ls # Here doesn't
  1. with errors and use_ansi_coloring:
nu -c "$env.config.use_ansi_coloring = false ; error make {msg: 'error still contains ansi'}"
  1. with errors and error_style:
nu -c "$env.config.error_style = 'plain' ; error make {msg: 'error is still fancy'}"

Expected behavior

Updating the config in the same way as for ls for all internal outputs

Screenshots

No response

Configuration

key value
version 0.93.1
major 0
minor 93
patch 1
branch main
commit_hash bdb6daa
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.77.2 (25ef9e3d8 2024-04-09)
rust_channel 1.77.2-aarch64-apple-darwin
cargo_version cargo 1.77.2 (e52e36006 2024-03-26)
build_time 2024-05-03 16:22:16 +04:00
build_rust_channel release
allocator mimalloc
features default, sqlite, system-clipboard, trash, which
installed_plugins

Additional context

No response

@39555 39555 added the needs-triage An issue that hasn't had any proper look label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage An issue that hasn't had any proper look
Projects
None yet
Development

No branches or pull requests

1 participant