Skip to content

Conversation

ValouBambou
Copy link
Contributor

@ValouBambou ValouBambou commented Oct 2, 2025

I tried the script on this page and was surprised to have it failed with the following error.

Error: nu::shell::column_not_found

  × Cannot find column 'USERNAME'
    ╭─[/home/user/.config/nushell/env.nu:27:69]
 26 │     let ssh_agent_file = (
 27 │         $nu.temp-path | path join $"ssh-agent-($env.USER? | default $env.USERNAME).nuon"
    ·                                                                     ──────┬──────┬
    ·                                                                           │      ╰── value originates here
    ·                                                                           ╰── cannot find column 'USERNAME'
 28 │     )
    ╰────

I fixed it by removing the part of the code where it defaults to the non-existing USERNAME. Maybe this var is needed in some other way, but in any case, I think this page needs to be updated.

PS: If this introduces error for other users ping me and I will update this PR

@fdncred
Copy link
Contributor

fdncred commented Oct 2, 2025

I think $env.USERNAME is a windows thing so there might need to be a windows way to do it and a non-windows way to do this.

@ValouBambou
Copy link
Contributor Author

Ok so since the right variable is checked even if the left part is not null, there is no solution using the same command. Maybe whoami is a better option here?

@ValouBambou
Copy link
Contributor Author

I confirm it works perfectly. I will modify my PR.

@fdncred fdncred merged commit 699640d into nushell:main Oct 2, 2025
1 of 2 checks passed
@fdncred
Copy link
Contributor

fdncred commented Oct 2, 2025

Thanks

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.

2 participants