• We did not send an email asking for donations - please read this post.

VScode can't find GHCI command from GHC on Pop_OS!

katsu

New Member
Joined
Sep 25, 2022
Messages
6
Reaction score
2
Credits
52
1664179936487.png


I have installed ghc via terminal using "sudo apt install ghc" so in my regular terminal, I can use ghci as you can see on the screenshot, but when I try to use it in vscode, it ends up with an error.
Does somebody have clue what can be wrong with it ?
 


JasKinasis

Well-Known Member
Joined
Apr 25, 2017
Messages
1,563
Reaction score
2,224
Credits
11,524
Ah Haskell!
I've used ghc and ghci in the terminal plenty of times since I first started learning Haskell. Not that I got very far with that! Ha ha!

But I've never used VSCode before, so I'm not sure what to suggest there. I tend to use tmux and vim in the terminal for all of my programming activities.

But I'd guess it probably has something to do with the environment variables that are set in the terminal used in VSCode.
The environment may be slightly different to that in bash in your distros default terminal, perhaps?!

Try running the following command in the terminal in VSCode AND in your main terminal and note the differences:
Bash:
echo $PATH
I'd bet that the $PATH in VSCode is different to the one in your usual terminal!

Re: fixing the problem, I'd imagine there's probably a setting in VSCode somewhere for customising the terminal environment.
But again - I don't use VSCode - so I'll leave that to you to explore.

It might also be worth checking that VSCode's integrated terminal actually IS running bash and not Powershell. I believe Powershell is also available on Linux now... Wouldn't surprise me if they've set that as the default terminal, ha ha! Sounds like something Microsuck would do.
And if that's the case, then changing VSCode's default terminal to bash should fix the problem. Assuming that they let you select which terminal to use!
 
OP
katsu

katsu

New Member
Joined
Sep 25, 2022
Messages
6
Reaction score
2
Credits
52
Ah Haskell!
I've used ghc and ghci in the terminal plenty of times since I first started learning Haskell. Not that I got very far with that! Ha ha!

But I've never used VSCode before, so I'm not sure what to suggest there. I tend to use tmux and vim in the terminal for all of my programming activities.

But I'd guess it probably has something to do with the environment variables that are set in the terminal used in VSCode.
The environment may be slightly different to that in bash in your distros default terminal, perhaps?!

Try running the following command in the terminal in VSCode AND in your main terminal and note the differences:
Bash:
echo $PATH
I'd bet that the $PATH in VSCode is different to the one in your usual terminal!

Re: fixing the problem, I'd imagine there's probably a setting in VSCode somewhere for customising the terminal environment.
But again - I don't use VSCode - so I'll leave that to you to explore.

It might also be worth checking that VSCode's integrated terminal actually IS running bash and not Powershell. I believe Powershell is also available on Linux now... Wouldn't surprise me if they've set that as the default terminal, ha ha! Sounds like something Microsuck would do.
And if that's the case, then changing VSCode's default terminal to bash should fix the problem. Assuming that they let you select which terminal to use!
Thx for the reply. I already figured it out by reinstalling VScode in Pop!Shop not via flatpak but by debian option.
1664223411888.png
1664223424474.png
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online

No members online now.

Top