VSCode: Different terminal account - visual-studio-code

I am using VSCode in Linux Ubuntu for my coding purposes. And I use the the existing terminal in the VSCode, The Terminal in VSCode and the OS terminal share the same history of commands. Is there any way to have separate profile for VSCode so that the each of the terminals have its own history.

Related

VSCode SSH auto-open terminal and run commands

I use VSCode with the Remote - SSH extension to connect to a remote dev enviroment.
During development on the remote machine, I use integrated terminal to view application logs. At this moment, I have to open new terminals and run commands manually, which is too much work for my lazy hands ;)
Questions are:
When I connect, I want VScode to open terminal tabs for me and run some commands (like tail ./logs/whatever). Is that possible?
If (1) is possible, can I also configure the terminals to open in VSCode Split Terminal mode?

VSCode terminal in ubuntu wsl

I've run into an issue where when I open vscode through WSL (command code.) it opens VSCode with no terminal whatsoever and there's no option to open one.
Terminal on WSL Ubuntu:
But when I run vscode from Windows I do have the option to use my Ubuntu terminal
Terminal on Windows:
Has anyone had similar issues? Did I miss a setting somewhere in VSCode?

WSL zsh Integrated VSCode User account change?

Hi not sure if this is possible or not to achieve, but I am looking to change the user account that is set when launching zsh terminal in VSCode from showing "Administrator" to "~" like it shows when you run VSCode with remote WSL and stand alone Ubuntu terminal.
Launching default VSCode:
Image
Launching VSCode via Remote WSL extension:
Image

Visual Studio Code - Where is the terminal history saved?

I noticed that the command history is saved when using Visual Studio Code. Using the arrow up and down keys, I can toggle through previously issued commands in the integrated terminal.
Where is the terminal history saved on the drive? Is it possible to open a file in notepad (or notepad++) and investigate the complete history, delete it?
I'm using Windows 10, and I have concluded that deleting the folders C:\Users\john\.vscode and C:\Users\john\AppData\Roaming\Code will not delete the terminal history for a particular project.
VSCode terminal use external shell. For linux the default shell is bash, I am not so sure about window, but I guess the default shell for window is powershell.
If your terminal shell is indeed powershell, this should help you locate the log file.
On Linux & MacOS, type the following command to display the path of the history file:
echo $HISTFILE
The history file may be different between VSCode and your regular terminal.
So you should type this command within the integrated terminal.
On Ubuntu you can see your history using this command:
vi ~/.bash_history

Integrated Terminal Setting VS Code and iTerm returns zsh

I'm trying to use iterm as my focus terminal inside vscode. I've setup "terminal.external.osxExec": "iTerm.app", but I get zsh instead of iTerm.
I'm able to right click on a file and open in iterm but I love the integrated terminal, and want to use iTerm here.
How do I use iterm as my terminal?
You cannot set iTerm as the integrated terminal for VS Code. I have explained below why.
iTerm is not a shell but a terminal emulator which in your case is running the zsh shell.
I believe you are confusing the terms Shell and a terminal emulator.
iTerm is a terminal emulator. Some examples of terminal emulator are Gnome terminal, Guake, Xterm etc. They provide a display to the shell which is installed in the OS.
A shell is a command line interface that reads and interprets your commands. Examples of shell are bash which comes by default in Linux and other shells like zsh, fish, sh.
Visual Studio Code integrated terminals use the shell itself and not the terminal emulator. In Windows OS the distinction between shell and terminal emulator is not present so Powershell and Command Prompt are both the shell and the emulator.
But for Unix like OSes there is a distinction.
I believe you use iTerm as the terminal emulator and the shell used is zsh (pronounced Z Shell which is a fork of bash Bourne Again Shell).
Here is a wikipedia article on Unix Shell. This talks about what a Unix shell really is.
This link is about Terminal emulators which also talks about the history of terminals.
This link gives a list of terminal emulators
that are available. iTerm is a terminal emulator for Mac OS.
Though you can customize your normal terminal using this
then later remember to go to settings then assign the new configurations to override the default ones
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.fontFamily": "Meslo LG S DZ for Powerline",
"terminal.explorerKind": "external",
The accepted answer has precisely addressed the question.
Here I will add a side note:
Why do you want iterm2 in integrated shell?
My answer is: I want the "copy on selection" feature of iterm2.
Actually vscode has this setting for the integrated terminal!
Settings > Terminal > Integrated: Copy On Selection
By the way, vscode also allows you to split the terminal, which is like iterm2.