Vaibhav Joshi
Vaibhav Joshi

Reputation: 53

How to open a new terminal within a terminal in Windows OS with Command Prompt

As I was going through it, it is possible in Ubuntu 20.04 LTS by using command gnome-terminal ?

Is it any command in Windows For the Same. Explain the OS Scenario behind it.

Upvotes: 4

Views: 7612

Answers (1)

mklement0
mklement0

Reputation: 437090

It's not entirely clear what you're asking, but here's a few pointers for Windows:

  • If you're using regular console windows (conhost.exe):

    • To open another cmd.exe console window from cmd.exe (run start /? for help):

      • start cmd
      • Or even just start by itself.
    • To open another PowerShell console window from PowerShell (run help Start-Process for help; alias start works too):

    • Of course, you're free to open a PowerShell window from cmd.exe and vice versa; just use the executable names shown above.

  • If you're using Windows Terminal (run wt -h for help or see the CLI documentation):

    • wt cmd / wt powershell / wt pwsh
      • Note: If you have created custom Windows Terminal profiles for your shells, use -p <profileName> instead of the executable name; e.g., wt -p myCmd instead of wt cmd, but be sure to specify the profile name exactly as defined, case-sensitively, otherwise the default profile is quietly used.
    • If you want to open a new tab in the same window (assuming you're calling from Windows Terminal):
      • wt -w 0 cmd / wt -w 0 powershell / wt -w 0 pwsh

As for the relationship between the original and the new console window:

  • While the process associated with the new window is a child process (that therefore inherits the caller's environment variables)...

  • ... it lives on independently of its parent; that is, terminating the parent process (such as by closing the original console window) has no impact on the child process (and its window).

Upvotes: 10

Related Questions