bevry / dorothy

๐Ÿง™๐Ÿปโ€โ™€๏ธ Bring your dotfile commands and configuration to any shell. Sensible defaults and hundreds of commands preloaded. Supports Bash, Zsh, Fish, Nu, Xonsh, Elvish, Dash, KornShell, macOS, Linux, Windows.
Other
277 stars 21 forks source link

Support: experience of nushell on WSL2 #197

Closed wasdee closed 5 months ago

wasdee commented 6 months ago

ref #196

for below issue, we might consider add docs, tell user what to do after or handle with automatic script

setup and context

Issue found

  1. dorothy not working since [nu config]/login.nu is not source
  2. carapace not found
  3. it shoud say how to remove sponsor msg, once in a while is acceptable.

dorothy not working since [nu config]/login.nu is not source

reproduce

  1. freshy install nushell
  2. install dorothy
  3. $env.DOROTHY not work

quick fix

append to [nu config]/config.nu

const env_path = ($nu.env-path | path dirname | path join login.nu)
source $env_path

carapace not found

reproduce

use MS terminal -> Ubuntu

Not found when use terminal via VSCode

error msg

Error: nu::shell::external_command

  ร— External command failed
    โ•ญโ”€[/home/nam/.local/share/dorothy/sources/autocomplete.nu:10:1]
 10 โ”‚         # init script is placeholder, so replace it
 11 โ”‚         carapace _carapace nushell  | save --force ~/.local/state/carapace/init.nu
    ยท         โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€
    ยท             โ•ฐโ”€โ”€ executable was not found
 12 โ”‚     }
    โ•ฐโ”€โ”€โ”€โ”€
  help: No such file or directory (os error 2)

Error: nu::shell::external_command

  ร— External command failed
    โ•ญโ”€[/home/nam/.local/share/dorothy/sources/autocomplete.nu:10:1]
 10 โ”‚         # init script is placeholder, so replace it
 11 โ”‚         carapace _carapace nushell  | save --force ~/.local/state/carapace/init.nu
    ยท         โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€
    ยท             โ•ฐโ”€โ”€ executable was not found
 12 โ”‚     }
    โ•ฐโ”€โ”€โ”€โ”€
  help: No such file or directory (os error 2)

workaround

run setup-util-carapace after this, once it shows open /home/nam/.config/carapace/specs: no such file or directory after another shell login terminal

balupton commented 6 months ago
  • carapace not found

Definitely a bug. Fortunately the fix for #196 will also allow a better fix for this too. I'll queue it up when I resume work.

open /home/nam/.config/carapace/specs: no such file or directory

Not sure what is happening there. Did it resolve?

dorothy not working since [nu config]/login.nu is not source

That's strange... during the install process (can be run again via dorothy install) did it configure itself for nushell? As it should inject source '$DOROTHY/init.nu' # Dorothy into $nu.loginshell-path. $DOROTHY is evaluated before it is written.

https://github.com/bevry/dorothy/blob/a0c26372296165db3947210e606bd7e0bcea5795/commands/dorothy#L1255-L1257

3. it shoud say how to remove sponsor msg, once in a while is acceptable.

How often would say is once in a while?

wasdee commented 6 months ago

open /home/nam/.config/carapace/specs: no such file or directory

Not sure what is happening there. Did it resolve?

this one might be it is creating the specs file after the fact. and sequential run it disappear

wasdee commented 6 months ago
  1. it shoud say how to remove sponsor msg, once in a while is acceptable.

How often would say is once in a while?

how about once a day?

wasdee commented 6 months ago

dorothy not working since [nu config]/login.nu is not source

That's strange... during the install process (can be run again via dorothy install) did it configure itself for nushell? As it should inject source '$DOROTHY/init.nu' # Dorothy into $nu.loginshell-path. $DOROTHY is evaluated before it is written.

https://github.com/bevry/dorothy/blob/a0c26372296165db3947210e606bd7e0bcea5795/commands/dorothy#L1255-L1257

I double check login.nu the nu's docs things work perfectly with the right parameter when run it e.g. nu -l -i

I missed this in both vscode and ms terminal. so, it appears that my nushell is not sourcing dorothy. ๐Ÿฅฒ sorry

"terminal.integrated.profiles.linux": {

        "bash": {
            "path": "bash",
            "icon": "terminal-bash"
        },
        "zsh": {
            "path": "zsh"
        },
        "fish": {
            "path": "fish"
        },
        "tmux": {
            "path": "tmux",
            "icon": "terminal-tmux"
        },
        "NuShell": {
            "path": "/home/linuxbrew/.linuxbrew/bin/nu",
            "args": ["--login", "-i"],
            "icon": "fold"
        },
        "pwsh": {
            "path": "pwsh",
            "icon": "terminal-powershell"
        }
    },
balupton commented 6 months ago

Can you send a PR to add VSCode instructions to https://github.com/bevry/dorothy/blob/master/docs/dorothy/dorothy-not-loading.md

wasdee commented 6 months ago

Can you send a PR to add VSCode instructions to master/docs/dorothy/dorothy-not-loading.md

sure

wasdee commented 6 months ago

https://github.com/bevry/dorothy/pull/200

balupton commented 6 months ago

merged yours PRs with some changes :-)

also, now there is a chance that you will be in the shoutout, as you are now a contributor! ๐Ÿš€ I wonder if you'll feel differently about its frequency now? ๐Ÿ˜‰

balupton commented 5 months ago

So what is left of this is the carapace fix. I did look through the code a few days ago and couldn't determine what could have caused the failure. However I'll try to freshly reproduce.

wasdee commented 5 months ago

merged yours PRs with some changes :-)

also, now there is a chance that you will be in the shoutout, as you are now a contributor! ๐Ÿš€ I wonder if you'll feel differently about its frequency now? ๐Ÿ˜‰

Thank you ๐Ÿ˜Š, as you see fit. This project is awesome. I just can't help myself to contribute. ๐Ÿคฃ

balupton commented 5 months ago

I have rewritten the carapace and starship logic locally, and will test thoroughly tomorrow.