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

  • Thread starter fog37
  • Start date
In summary, many applications come with their own terminal instead of using the native shell to provide a controlled environment tailored to the specific needs of the application. This approach enhances usability by offering features such as built-in commands, customized settings, and improved user interfaces. It also ensures compatibility across different systems and reduces the risk of conflicts with user configurations in the native shell. Additionally, a dedicated terminal can streamline user experience by integrating application-specific functionalities directly, leading to more efficient workflows.
  • #1
fog37
1,569
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
  • #2
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
  • #3
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?
 
  • #4
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.
 

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

1. Why do applications use their own terminal instead of the system's native shell?

Applications often use their own terminal to provide a controlled environment that can include specific configurations, features, and enhancements tailored to the application's needs. This allows developers to ensure that the user experience is consistent and that the application behaves predictably regardless of the user's system settings.

2. What advantages does a custom terminal offer to users?

A custom terminal can offer users features such as better integration with the application, improved performance, enhanced security, and additional functionalities that may not be available in the native shell. This can include syntax highlighting, command history, and easy access to application-specific commands, which can enhance productivity and usability.

3. Are there any downsides to using a custom terminal?

Yes, there can be downsides. Users may find it inconvenient to switch between different terminals, leading to a fragmented experience. Additionally, custom terminals may lack some advanced features present in the native shell or may not be as flexible for general-purpose tasks. This can limit users who are accustomed to the capabilities of their native environment.

4. How do developers decide whether to implement a custom terminal?

Developers typically assess the needs of their application and the target audience. If the application requires specific functionalities that the native shell cannot provide or if it needs to maintain a consistent user experience across different platforms, a custom terminal may be deemed necessary. Usability testing and user feedback also play a crucial role in this decision-making process.

5. Can a custom terminal impact system performance?

In some cases, a custom terminal may impact system performance, especially if it is resource-intensive or poorly optimized. However, if designed well, it can operate efficiently alongside the native shell. Developers need to consider performance implications during the design phase to ensure that the custom terminal does not adversely affect overall system performance.

Back
Top