Why do many applications come with their own terminal instead of using the native shell?

  • Thread starter Thread starter fog37
  • Start date Start date
AI Thread Summary
Shell programs like CMD, PowerShell, bash, and others are often bundled with applications such as Git, Anaconda, and VS Code, which provide their own terminal instances. These terminals are configured to launch with specific environment variables tailored for particular tasks, such as Python development or version control. This setup allows users to start in a designated environment or directory without additional commands, streamlining the workflow.Using these specialized terminals helps avoid the need to manually set paths or configurations each time, as they inherit relevant environment variables from their parent processes. This is particularly useful for ensuring that subsequent commands and executables behave correctly based on the context of the work being done. The discussion highlights the importance of understanding different shells and their scripting languages, suggesting that familiarity with both bash and PowerShell can enhance cross-platform usability.
fog37
Messages
1,566
Reaction score
108
Hello,

I recently started a thread about shell programs (CMD and Powershell for Windows, bash and else for Linux and Mac).

I noticed that many applications, like Git or Anaconda, VS Code, come with their own terminal...Why? Those "terminals" are really different shells or instances of the native shell but with some configuration setting already launched?

For example, Anaconda has the Anaconda terminal (which starts in the Anaconda base environment)...Git has Git bash, VS code has its terminal window...What advantage does this bring instead of using the native shell on our system?

Also, I have to say that it is getting confusing to learn commands from different shells....do you guys stick with just one shell and its scripting language? But it seems very useful to know both bash and Powershell so we can work with different OS...

Thanks!
 
Technology news on Phys.org
The
fog37 said:
instances of the native shell but with some configuration setting already launched
This. The general idea is to launch a shell window (command prompt) with the proper set of environment variables for a particular kind of work (git, python, etc.). Most commonly you would like the path variable set to allow the shell interpreter to find the desired executables without you have to type long path prefix every time. This pattern is quite universal across all shell interpreters and operating systems based on the POSIX standard and ties into how to launch processes with a known environment.
 
  • Like
Likes FactChecker and fog37
Thank Filip. Just to make sure, the environment variables are set (unless we change them). So launching this or that shell does not change the values assigned to the environment variables...But starting with a specific shell is like starting directly in a specific folder or virtual environment from the get go without having to type extra commands...

Is that correct?
 
I am not exactly sure what you are asking. You originally asked about starting a command prompt associated with some environment (e.g. Anaconda or git) and in that case the command interpreter is typically launched and given some specific environment settings (e.g. in a resource file) that will make sense in that particular work case, including current working directory. So in that sense, yes, launching a shell will typically modify the system environment a bit for that shell so that the shell has what it needs and so that additional executables started from that shell gets relevant environment variables set as well.

Note that environment variables set in a parent process is by default inherited by child process when it is started by that parent. For example, a git shell may setup git specific environment variables that will allow subsequent programs (i.e. typically the git executable itself) adapt relevant behavior based on those variables. This is a bit in contrast to having an application-specific configuration or project file (typically used for larger UI applications) that you then specify to all the executables that needs it (or it looks for one relative to the current working directory or using a search path environment variable). For example, the Visual Studio command line build system is an example of a set of executables that are highly configurable using a mix of both environment variables and configuration/project files.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
hi; i purchased 3 of these, AZDelivery 3 x AZ-MEGA2560-Board Bundle with Prototype Shield and each is reporting the error message below. I have triple checked every aspect of the set up and all seems in order, cable devices port, board reburn bootloader et al . I have substituted an arduino uno and it works fine; could you help please Thanks Martyn 'avrdude: ser_open(): can't set com-state for "\\.\COM3"avrdude: ser_drain(): read error: The handle is invalid.avrdude: ser_send(): write...
Back
Top