You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deleting nushell config directory leads to crash #5203
When deleting the nushell config folder (~/.config/nushell in my case) a running instance of nu terminates.
How to reproduce
Make sure no instance of nu is running.
Delete the nushell config directory eg. ~/.config/nushell
Start nu
Would you like to create one with defaults (Y/n): -> n
Would you like to create one with defaults (Y/n): -> n
Run rm --recursive --force ( $nu.config-path | path dirname )
No environment config file found at /home/oli/.config/nushell/env.nu
Would you like to create one with defaults (Y/n):
n
Continuing without config file
No config file found at /home/oli/.config/nushell/config.nu
Would you like to create one with defaults (Y/n):
n
Continuing without config file
/home/oli〉rm --recursive --force ( $nu.config-path | path dirname ) 04/15/2022 12:55:37 PM
╭───┬───────────────────────────────────╮
│ 0 │ deleted /home/oli/.config/nushell │
╰───┴───────────────────────────────────╯
Error:
[Process didn't exit cleanly. (exit_behavior="CloseOnCleanExit")]
× No such file or directory (os error 2)
The error message at the end comes from WezTerm. Your particular terminal emulator might react differently.
Expected behavior
I expected nu to ask to recreate the missing config files, like it did on first start.
@WindSoilder Hi, do you mean the latest release or the main branch?
Assuming you meant latest release, the issue is reproducible.
I have amended the steps to reproduce, because I found them not as clear as they could be.
I have tested again with latest main branch and it seems I can also reproduce the issue.
oli@pop-os:~/Workspace/nushell$ git rev-parse --verify HEAD
a75318d7e8bc8d88043d2e982b26dcb58308acb6
oli@pop-os:~/Workspace/nushell$ ls ~/.config/nushell
ls: cannot access '/home/oli/.config/nushell': No such file or directory
oli@pop-os:~/Workspace/nushell$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.15s
Running `target/debug/nu`
No environment config file found at /home/oli/.config/nushell/env.nu
Would you like to create one with defaults (Y/n):
n
Continuing without config file
No config file found at /home/oli/.config/nushell/config.nu
Would you like to create one with defaults (Y/n):
n
Continuing without config file
/home/oli/Workspace/nushell〉rm --recursive --force ( $nu.config-path | path dirname )
Error:
× No such file or directory (os error 2)
oli@pop-os:~/Workspace/nushell$
Personally I'd suggest no need to recreate the missing config files, just restart nu is enough
As long as it does not panic, this would be also fine from my point of view.
gabriel at pop-os in ~/C/nushell
↪ echo $RUST_BACKTRACE
full
gabriel at pop-os in ~/C/nushell
↪ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Running `target/debug/nu`
No environment config file found at /home/gabriel/.config/nushell/env.nu
Would you like to create one with defaults (Y/n):
y
Config file created at: /home/gabriel/.config/nushell/env.nu
No config file found at /home/gabriel/.config/nushell/config.nu
Would you like to create one with defaults (Y/n):
y
Config file created at: /home/gabriel/.config/nushell/config.nu
/home/gabriel/CodingProjects/nushell〉rm -rf ($nu.config-path | path dirname) 06/04/2022 02:06:48 PM
Error:
× No such file or directory (os error 2)
Activity
WindSoilder commentedon Jun 3, 2022
@bugabinga Hi, can you please try latest build and check if it's still panic?
Personally I'd suggest no need to recreate the missing config files, just restart
nuis enoughbugabinga commentedon Jun 3, 2022
@WindSoilder Hi, do you mean the latest release or the
mainbranch?Assuming you meant latest release, the issue is reproducible.
I have amended the steps to reproduce, because I found them not as clear as they could be.
bugabinga commentedon Jun 3, 2022
I have tested again with latest
mainbranch and it seems I can also reproduce the issue.As long as it does not panic, this would be also fine from my point of view.
WindSoilder commentedon Jun 3, 2022
Sorry for my unclear message, I mean the latest
main.Can you please try
cargo cleanfirst, then runcargo runand check again?bugabinga commentedon Jun 3, 2022
No problem:
💻/nushell main ▶ cargo clean ✓ 03.06 19:51 💻/nushell main ▶ cargo run 629ms ✓ 03.06 19:53 Updating crates.io index Updating git repository `https://github.com/nushell/reedline` Downloaded bytesize v1.1.0 Downloaded byteorder v1.4.3 Downloaded adler v1.0.2 Downloaded bytes v1.1.0 ... Compiling nu-parser v0.63.1 (/home/oli/Workspace/nushell/crates/nu-parser) Compiling nu-cli v0.63.1 (/home/oli/Workspace/nushell/crates/nu-cli) Finished dev [unoptimized + debuginfo] target(s) in 6m 38s Running `target/debug/nu` 💻/nushell main ▶ rm -f ($nu.config-path | path dirname) 823ms ✓ 03.06 20:00 Error: × No such file or directory (os error 2) Error: × No such file or directory (os error 2)We get 2 errors because I launched
cargo runinside nu.This time a also set
$env.RUST_BACKTRACEtofull, but apparently there is no panic here.WindSoilder commentedon Jun 4, 2022
Hmm.....The error message shouldn't occurred, I can't reproduce it in my machine:-( I'll try linux in other day
merelymyself commentedon Jun 4, 2022
and of course,
WindSoilder commentedon Jun 4, 2022
What about trying this? In linux, I can use this to make a fresh
nubuild with the newestreedlinedependencybugabinga commentedon Jun 15, 2022
@WindSoilder well done!
The issue seems fixed after following your instructions. Or it is simply gone in
0.64.0:).