new startup tabs

Jan 13, 2013
20
0
#1
Hi. I'm running tcmd 21 build 20 x64 on win10.
I am trying to learn something new w/ tcmd. For many years, I would start tcmd and then manually open a few tabs to the directories I want. Now I want that to happen automatically. I figured out that options > take command > tabs, I can type the full path to tcc.exe and that would open as many tabs as I do this for.

What I cannot get to work is then changing into the directory I want for each tab. For example, I want one tab to be in %gopath\src. I tried entering this in the directory configuration option, and trying to pass a cd command to tcc. It either does not work or I get an error message.

How do I get a new tab to open upon starting tcmd, and log tcc into the directory I want?

--rob solomon
 
Jan 13, 2013
20
0
#3
That helps. Long ago I put a cd in my tcstart.bat so that I could load my alias file from %userprofile\Documents

So my follow up question, what is the recommended best way to load the same alias file for all tcmd/tcc instances regardless of version?
 
Jan 13, 2013
20
0
#4
I need to add that I have versions of tcmd that go back decades. So let me rephrase my question, and limit myself to tcmd >= 17, and for tcc/le which I use for my VMs. All use the same alias copied to where it needs to be.
 

rconn

Administrator
Staff member
May 14, 2008
10,638
97
#5
Are you running global aliases (in which case only one of your tabs needs to run SHRALIAS)? You can put a check in TCSTART to see if SHRALIAS is loaded and skip it if it's already there. If not, load SHRALIAS and do a alias /r.

If you're running local aliases, just put an unconditional "alias /r" in your TCSTART.
 
Jan 13, 2013
20
0
#6
I used to do that. But then I got tripped up over directories and where to put my alias file, I call ALIASDEF.TXT.

So if I put an unconditional alias/r ALIASDEF.TXT, where does my ALIASDEF.txt have to be?

And I am not using local aliases, only global ones. I don't know what SHRALIAS is.
 
#7
SHRALIAS is an internal command which starts SHRALIAS.EXE. SHRALIAS.EXE guards 4 lists (or however many it finds) so they continue to exist when TCC is not running. New TCCs with global lists will attach to those lists instantly. The lists are history, dirhistory, alias, and function. I use all the lists globally, all the time. Use any that you like. If the system or user variable SHRALIAS_SAVE_PATH is set, SHRALIAS.EXE will save the lists when it exits (for me, that's at logoff). Here's what I do. The files are called history.sav, dirhistory.sav, alias.sav, function.sav.

In a Windows logon BTM ...

:: go where the lists are stored
cdd %SHRALIAS_SAVE_PATH
:: load the lists
do c in /L history dirhistory alias function ( %c /r %c.sav )
shralias
cdd -

I never think about it again. When I logoff, shralias.exe saves the lists before it exits. The lists are always there, for all TCC sessions, as long as the logon session lasts (which can be weeks or months here).
 
Jan 13, 2013
20
0
#8
Thanks Vince. But how do you get those 4 files created initially? And how do you change them?

Over time, my aliases have changed since I first wrote them sometime in 1988 or so. I think you have been using tcmd just as long.
 
#9
They should be created automatically upon logoff or SHRALIAS /U. They're not loaded automatically (that's why I load them in a logon script). I don't usually edit them. Any changes to history, dirhistory, functions, or aliases go into the (guarded) lists which are saved (as above). You can edit them and perhaps re-load them. They're Unicode, so use notepad or something else that handles Unicode (and preserves the BOM) if you edit them. As I said, I never think about them. Whatever the state of my global history, dirhistory, function, and alias lists, they're remembered (automatically) on logoff and restored (via my logon script) upon logon.
 
Jan 13, 2013
20
0
#13
David, that occurred to me after I posted. After all, the act of writing stimulates more thought. At least that has always happened to me. I do that now. I made 2 changes to my tcstart.bat because of this discussion: I am now using shralias, and I now do include the path to the alias file, in the form of "%programdata\JP Software\ALIASDEF.TXT"

Thanks to all of you who responded.