Cloning the path is easy if you can run your terminal program from the command line. Assuming you're using xterm
, just run xterm &
from the prompt of the terminal you want to clone. The new xterm will start in the same directory, unless you have it configured to start as a login shell. Any exported environment variables will also carry over, but un-exported variables will not.
A quick and dirty way to clone the whole environment (including un-exported variables) is as follows:
# from the old shell:
set >~/environment.tmp
# from the new shell:
. ~/environment.tmp
rm ~/environment.tmp
If you've set any custom shell options, you'll have to reapply those as well.
You could wrap this whole process into an easily-runnable script. Have the script save the environment to a known file, then run xterm
. Have your .bashrc check for that file, and source it and delete it if found.
Alternately, if you don't want to start one terminal from another, or just want more control, you could use a pair of functions that you define in .bashrc:
putstate () {
declare +x >~/environment.tmp
declare -x >>~/environment.tmp
echo cd "$PWD" >>~/environment.tmp
}
getstate () {
. ~/environment.tmp
}
EDIT: Changed putstate
so that it copies the "exported" state of the shell variables, so as to match the other method. There are other things that could be copied over as well, such as shell options (see help set
) -- so there is room for improvement in this script.
Under the main (little mousy) menu, there is a "Settings" entry.
In there there is a "Default Applications" entry -- that's where you can change the default terminal emulator, the default browser, and the file-manager.
The dialog will present choices it deems suitable for each -- so be sure to have the desired application installed and present in the $PATH
before looking for it there.
Best Answer
You can easily wrap up a script using find and rl (package randomize-lines on debian).
Something along the lines of: