Spawn New Cygwin Window from Within Cygwin

16

1

I can't figure out how to launch a new Cygwin session from within Cygwin, similar to launching a new terminal from within bash with:

gnome-terminal

It's probably easy but I am missing something. Any ideas?

nicorellius

Posted 2010-06-24T15:36:40.720

Reputation: 5 865

Answers

16

cygstart /bin/bash -li

ak2

Posted 2010-06-24T15:36:40.720

Reputation: 3 387

2to retain all mintty settings in the child window use: cygstart mintty /bin/bash -il – Grant Humphries – 2016-12-13T00:38:24.637

6

Press 'Alt-F2' if you only want to open another terminal(mintty) in mintty, not from within a script. See 'man mintty' for other keyboard shortcut.

Leech Daemun

Posted 2010-06-24T15:36:40.720

Reputation: 61

I think this is the best answer, it opened up another terminal window with the same settings as the window that spawned it, where as cygstart /bin/bash -li opens a new terminal window, but doesn't have the same settings. – Craig London – 2016-12-08T17:09:48.713

@CraigLondon see my comment on the accepted answer to retain those settings with that approach, the difference between that answer and this one is that the shell that is launched in the former case is a child, thus inheriting from the parent, that is not the case here. – Grant Humphries – 2016-12-13T00:42:58.850

3

if you use the "default" cygwin console (aka cmd.exe) then:

cmd /c start /d "C:\cygwin\bin" SHELL.EXE PARAMS

and then replace SHELL.EXE and PARAMS by what you use:

  • zsh: zsh.exe -l
  • bash: bash.exe --login

i would advise you to use a better console like 'mintty' or 'rxvt', which you launch just by typing "mintty" (or pressing f2) or "rxvt".

akira

Posted 2010-06-24T15:36:40.720

Reputation: 52 754

I think my version of Cygwin is using bash.exe and I fiddled around with the command you provided and some variations with no luck. Looking into mintty now. Thanks! – nicorellius – 2010-06-24T16:09:52.800

2mintty from within an existing Cygwin terminal will start a new window, yes, but also lock up the existing terminal. Start it as a background process with mintty & to continue using the original terminal and have a new one. – Shane Daniel – 2012-02-28T04:35:49.023

1

In order to load also my .bash_profile, I've created an alias in my .bashrc with the following command :

alias mintty='mintty.exe -i /Cygwin-Terminal.ico - &'

JBE

Posted 2010-06-24T15:36:40.720

Reputation: 224