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

use which to search nu location, add icon too. #153

Merged
merged 5 commits into from Sep 17, 2023
Merged

use which to search nu location, add icon too. #153

merged 5 commits into from Sep 17, 2023

Conversation

nerditation
Copy link
Contributor

I tried out the vscode extension today and it gave error. so I looked at the code and found out the nu installation detection logic is manually searching through a hard coded list of directores, but my setup happens to be not in any of the presumed locations. so I modified the code to use which to search in ${env:PATH}, plus these additional locations, and also simplfied the code a little bit during the process.

also, I don't like the generic "terminal" icon, and I find there's already a svg icon file in the assets folder so I just point the terminal profile icon path to that svg file.

if the profile provider returns undefined, users will get a confusing error message:

```
No terminal profile options provided for id "nushell_default"
```

if we instead just return a program name "nu", the error message became:

```
path to shell executable "nu" does not exist
```

which should give the user more clue what went wrong.
client/src/extension.ts Outdated Show resolved Hide resolved
@fdncred
Copy link
Collaborator

fdncred commented Sep 16, 2023

I think this is an excellent idea. Thanks for adding this. I just had a few notes above. Appreciate your help!

yup, the svg icon is a good call.

the error message also guide the user to install `nushell` from website and reload vscode.
@fdncred
Copy link
Collaborator

fdncred commented Sep 16, 2023

ok. I think we're good here if we can just get the ci green. thanks for your help and explanations! I wrote this mess, with some help, but I'm no good at javascript/typescript stuff. :)

@nerditation
Copy link
Contributor Author

oops, look like the linter doesn't like an empty function body. replaced with an empty value. should fix it now.

@fdncred
Copy link
Collaborator

fdncred commented Sep 17, 2023

Thanks!

@fdncred fdncred merged commit 7d91ec9 into nushell:main Sep 17, 2023
1 check passed
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.

None yet

2 participants