1
1
What I need is an icon on my desktop that I can double-click, and launch terminal, but already cd'd to specific directory.
I know how to configure Terminal.app to automatically cd to a specific directory on launch; I would like a quick way to launch into one of many directories (to work on one of several git repositories without having to navigate up and down the file system).
I tried creating a text file containing the following shell script:
cd /Users/me/MyFolder
and saving it with the name and extension GoToDir.command
.
However, when I double-click on the file, Terminal launches with this contents on the console:
Last login: Mon Aug 28 20:14:31 on ttys000
Machine-Name:~ username$ /Users/username/Desktop/GoToDir.command ; exit;
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
...and input is disabled. Clearly, this .command
is run as a one-off program that terminates, and that's it.
How do I keep the console "alive"?
I downloaded it but am unable to install it (Finder toolbar does not accept drag and drop). – Nicolas Miari – 2017-08-29T04:57:55.660
1Looks like you need to hold the Command key down to drag into the toolbar now. – jimtut – 2017-08-29T11:15:55.483
Oh, thanks! It's working now. Too bad the icon hasn't been updated to match the current look of Finder... – Nicolas Miari – 2017-08-29T11:26:15.663
1Glad it works. You should be able to assign any icon you want to the original ShellHere program (Finder -> Get Info). You might need to remove/replace the icon in the toolbar to get it updated there. – jimtut – 2017-08-29T15:04:42.623