• We had to restore from a backup today after a failed software update. Backup was from 0000 EDT and restored it at 0800 EDT so we lost about 8hrs. Today is 07/20/2024. More info here.

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

katsu

New Member
Joined
Sep 25, 2022
Messages
8
Reaction score
3
Credits
72
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 ?
 


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!
 
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
 


Top