Bash History-like feature for Windows Command Prompt
the old thing is called 'doskey'. it is in fact quite a familiar sight for us old buddies...
check out its help page:
C:\Users\bubu>doskey /? Edits command lines, recalls Windows commands, and creates macros. DOSKEY [/REINSTALL] [/LISTSIZE=size] [/MACROS[:ALL | :exename]] [/HISTORY] [/INSERT | /OVERSTRIKE] [/EXENAME=exename] [/MACROFILE=filename] [macroname=[text]] /REINSTALL Installs a new copy of Doskey. /LISTSIZE=size Sets size of command history buffer. /MACROS Displays all Doskey macros. /MACROS:ALL Displays all Doskey macros for all executables which have Doskey macros. /MACROS:exename Displays all Doskey macros for the given executable. /HISTORY Displays all commands stored in memory. /INSERT Specifies that new text you type is inserted in old text. /OVERSTRIKE Specifies that new text overwrites old text. /EXENAME=exename Specifies the executable. /MACROFILE=filename Specifies a file of macros to install. macroname Specifies a name for a macro you create. text Specifies commands you want to record. UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays command history; ALT+F7 clears command history; F8 searches command history; F9 selects a command by number; ALT+F10 clears macro definitions. The following are some special codes in Doskey macro definitions: $T Command separator. Allows multiple commands in a macro. $1-$9 Batch parameters. Equivalent to %1-%9 in batch programs. $* Symbol replaced by everything following macro name on command line. C:\Users\bubu>
it doesn't keep the history in a file though, you can of course use doskey /history >file and stuff to do that, but it is not as automated as bash. ctrl-c generates interrupt and thus is not used in consoles. even xterm wouldn't allow that. (xterm uses mouse select as copy and right click as paste, for the matter)
alternatively, you can use cygwin and use bash instead... it also runs on windows.
Console can use more than just the Windows cmd.exe
as its target shell. If you download, for example, the Windows port of the BASH shell you can use that instead under Console. This, in conjunction with additional tools like the MinGW (which includes the BASH for Windows port along with many of your favorite *nix terminal standbys like ls
and wget
) or GNUWin32 programs in your system path can give you a very Unix-y console in Windows.
Try TCC/LE, which features command line editing and history, among others. It's the freeware edition of the Take Command environment software.
Once you have it installed, you can specify which aspect you want logged (commands, errors, history) and in which file you want them saved. TCC/LE can be used in combination with either Console or ConEmu.