History resetting itself

Aug 31, 2011
14
0
My history is reset after I run certain commands and I lose all my recent command history.

For example, I use "windres -o whatever.o whatever.rc" (windres is in the tdm-gcc-4.6.1 package from http://tdm-gcc.tdragon.net/download) and my history is reset to whatever it was before I opened the shell and windres isn't in the history. (windres spawns gcc..).

Is there a way to fix this?
 

rconn

Administrator
Staff member
May 14, 2008
12,364
150
My history is reset after I run certain commands and I lose all my recent command history.

First, are you using local or global command history? What version of Take Command / TCC are you running? Are you running TCC in a Take Command tabbed window or in a stand-alone console?

The only way that the history list can be cleared is if you've got a HISTORY command somewhere -- in your TCSTART, in your PRE_INPUT, PRE_EXEC, or POST_EXEC aliases, or if you're starting secondary shells and you've defined an autoload history file (OPTION / Command Line / History File).
 
Aug 31, 2011
14
0
I have a History File set (OPTION / Command Line / History File), I am using TCC from within Take Command 13, and all my Local lists (OPTION / Startup) are Unchecked as I'd like a global history. I do not have a HISTORY command in TCSTART.

I guess windres is starting secondary shells to spawn gcc, but I want to keep a history file without it being reset. What can I do?
 

rconn

Administrator
Staff member
May 14, 2008
12,364
150
I guess windres is starting secondary shells to spawn gcc, but I want to keep a history file without it being reset. What can I do?

The history file in its current incarnation is not really intended to be used with global history lists or when spawning multiple secondary shells. (Actually a bit of a misnomer, since as far as Windows is concerned there isn't such a thing as a secondary shell.) I'd recommend putting a HISTORY /R in your TCSTART, and conditioning it based on whether you're in a transient shell; i.e. something like:

if %_transient == 0 history /r historyfile
 
Aug 31, 2011
14
0
Should I be saving this global history in TCEXIT or would that also cause overwrite problems with multiple tcc tabs when they close?
history > historyfile
 

rconn

Administrator
Staff member
May 14, 2008
12,364
150
Should I be saving this global history in TCEXIT or would that also cause overwrite problems with multiple tcc tabs when they close?
history > historyfile

If you're using global history lists, you can save it to a file in TCEXIT. If you're using local lists, it would be a Very Bad Thing. (Unless you use a different file for each tab.)
 
Similar threads
Thread starter Title Forum Replies Date
J History file load hangs if file has complete garbage in it... Support 1
R History window wrong size, can't remember size change Support 12
T How to? retain command history across reboot? Support 6
nikbackm Speeding up the history dialog Support 6
D ParentDirectory does not update directory history Support 6
vefatica Command history search is off Support 7
D Directory History Window with wildcard search Support 3
R Long commands retrieved from command history have blank line when wrapped Support 20
Joe Caverly @HISTORY issues Support 4
vefatica Deleting entries in the command history popup? Support 3
H History and TPipe Oddness Support 3
D History and control-C Support 1
G Console exe up / down history Support 8
D What does the file "..\Everything\Run history.csv" store? Support 5
rps Cmd history recall Support 4
David McClelland Command history loosing entries Support 18
R history features. Support 6
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
M Ctrl-C when using command line history does nothing Support 2
S Debugger Bat file call history Support 9
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
vefatica ESC after recalling a command from history Support 3
T TCHelp executable history? Support 2
thorntonpg @blahblah added to history. Support 0
M Call History popup-window? Support 0
M HISTORY lessons ... Support 0
vefatica The help and IE's history Support 16
D Towards shared (dir-)history lists Support 3
vefatica Ctrl-Enter in command history window? Support 8
vefatica History recall turns off Quick-Edit Support 4
C history is getting deleted under unknown circumstances Support 9
R V19 - At startup, TCC save directory in the directory history list Support 2
T [TCC 18] Can't read nor write history Support 1
I Possible Bug: History /n Returns Nothing Support 3
jbanaszczyk Lost history Support 4
T history.sav Support 4
T How to? sort history in tcexit.btm Support 22
vefatica OT: Windows console history? Support 7
S directory history locks up TCC Support 3
R In addition to ALIAS /Z and FUNCTION /Z, HISTORY /Z? Support 1
E TCC History popups too small Support 0
C How to? Keeping all history lists Support 4
E Command History not showing on up arrow button Support 8
nikbackm HISTORY /R1 performance Support 3
T Selecting line from popup history without executing Support 8
A How to? Filter history list with unicode chars Support 0
vefatica WAD HISTORY /R, No closing quote? Support 10
vefatica WAD DO /S ... all dirs wind up in the history! Support 12
D Dir History file check Support 18
ehab aboudaya How to? Command Input history for each tab? Support 0

Similar threads