![]() Just add `echo w > ~/.last_cwd_$$` to the prompt string. ![]() bash_logout, put the following: & rm ~/.last_cwd_$$That's it! Now, if you use a different prompt string than the default, that should still work with this hint. bashrc, add the following: # set up PS1export PS1='h:w u$ `echo w > ~/.last_cwd_$$`'And in. last_cwd_* do & ( kill -0 $ || rm $I ) 2> /dev/nulldone# find youngest viable last_cwd and change thereL="`ls -1tr. bash_profile, add the following: # nuke stale. To implement this hint, you need to edit three files. Then bash's default login and logout scripts take up the rest of the slack. This allows recording the current directory to a file whenever you get a new shell prompt. The trick is to add some shell code in your prompt string itself. With some bash scripting, however, you can have Terminal open up each new window in the last directory you had a prompt in among your other open Terminal windows. OS X's Terminal.app functions differently, making such a shortcut difficult. UNIX / X11 users could always easily open a new xterm in the same directory as an existing xterm by typing xterm at the prompt. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |