skip to Main Content

So I initially used windows, but recently decided to switch to linux. In windows, my vscode terminal look like this:
enter image description here

It shows which directory I am in. But when i try vscode in linux, i get this on run:

enter image description here

It shows nothing but sh-5.1, which i don’t know what is it. And when i run a simple c program:
enter image description here

the output is on the same line as the sh-5.1. How to change the terminal to look like in windows? (not exactly the same, I mean at least show the directory and generate a newline when done running program)

2

Answers


  1. You can simply write:

    bash
    

    to your console since bash shell is the closest one to what you want. Your current shell is sh. To switch back to sh, you can write sh again. To see other available shells in your computer, you can write: cat /etc/shells

    If you don’t have bash installed on your computer (which is pretty unlikely), you can install it by:

    sudo apt-get install bash
    
    Login or Signup to reply.
  2. If you want to fix it on the VSCode terminal or make it stay that way, go to Settings. Type ‘Linux exec’ in the search bar. You should see ‘Terminal > External Linux Exec.’ Change it to your preferred terminal, like mine, gnome-terminal
    you should see this
    Change it to your preferred terminal.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search