0

I have the following as a pre-defined task in Cmder which should open gitbash and then run a command (in this case im just using "ls" for simplicity) on startup but keep the shell open.

> -cur_console:d:%userprofile%\Coding\My_location -cur_console:t:"My Server" cmd /c ""%ConEmuDir%\..\git-for-windows\bin\bash" --login -i -c ls" -new_console:c

The problem is that the command runs and then asks to press Enter to close the terminal. I would like the terminal to remain open after running that command. Im guessing I have to change something with the "-c ls" but not sure what!

Thanks!

asked Jul 22, 2021 at 21:45
3
  • 3
    Change -c ls to -c 'ls; exec bash' Commented Jul 22, 2021 at 22:13
  • Amazing thank you Philippe!! Just out of curiosity, where did you find out about this from? It was very hard to find any good documentation about this. Commented Jul 23, 2021 at 8:33
  • 2
    For this particular one, it's from experience. -c takes a string which can contain multiple commands, which is why I put ls followed by exec bash which spawn another interactive shell. Commented Jul 23, 2021 at 9:24

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.