Hi,Does anyone know how to access the "up arrow" (history) command in the tksurfer shell. E.g. backspace maps to ctl-h. Thanks! _________________________________________________________________ PC Magazine’s 2007 editors’ choice for best web mail—award-winning Windows Live Hotmail. http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migr...
Hi Troy -
On Wednesday 01 August 2007 12:54, Troy Mcan wrote:
Hi,Does anyone know how to access the "up arrow" (history) command in the tksurfer shell. E.g. backspace maps to ctl-h. Thanks!
Unfortunately the tclsh has very limited interactive capability. The ability to act like a "regular" shell (such as 'bash' or 'tclsh') and have history functionality, to do <tab> completion of file and directory names, etc, simply does not exist in the tclsh.
In fact, this is probably the most common stumbling that most users of the tclsh (which include tksurfer and tkmedit) encounter very soon in their dealings with tclsh.
There is a solution, however. This "extended" functionality is provided by the GNU readline library, and in fact there is such an extension to the tclsh. See here:
http://tclreadline.sourceforge.net/
I'd only suggest attempting this if you are reasonable comfortable with UNIX-type admin, but the instructions at the above site are staightforward to follow. Basically you'll compile an additional libary and allow your local tclsh to use this.
Of course, if you install this library, it will only "modify" the behaviour of the tclsh that is installed by default on your system, and not the version of the tclsh that FreeSurfer uses.
It's a bit of a hack, but you once you have modified your local tclsh to be readline aware, you can try various approaches:
* replace the FreeSurfer versions with your new readline-aware tclsh, or * change the way FreeSurfer sets the PATH environment variable so that it picks up your system readline-aware tclsh first, and not the FreeSurfer bundled tclsh.
FWIW, I have used the second approach successfully, so it can and does work.
-=R
freesurfer@nmr.mgh.harvard.edu