mklement0 / ttab

macOS and Linux CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
283 stars 15 forks source link

How to Close the Opened tab or Window? #22

Closed wahello closed 4 years ago

wahello commented 5 years ago

It will get closer to perfect if ttab has function to close the opened tab/window.

mklement0 commented 5 years ago

@wahello: exit normally not just exits the process, but also closes the window / tab.

Are you thinking of scenarios where exiting the process (shell) doesn't close the window / tab?

I know that you can configure Terminal.app to do the latter, but it's just as easy to turn that off.

Can you elaborate on when you think this would be useful?

mklement0 commented 4 years ago

In case you meant instructing ttab to automatically close the new tab after a given command has finished:

For a single command, prepend exec; e.g.:

ttab -t 'Will close when find finishes' exec find $HOME

For a multi-command command line; append ; exit; e.g.:

ttab -t 'Will close when you press a key once finished' 'find $HOME; echo Press a key to exit.; read -rsn 1; exit'