It seems to me really miss the team history (as in Linux). When I leave the console, all entered by me in the team session are forgotten. It is very inconvenient.
It sounds like you are referring to command history. Command history is a function of the shell program not the console program. In linux, most of the command shells (like bash) will save command history in a file that can be recalled when the shell is run again. In windows, the command shell cmd.exe does not save command history. Console can't do much about the deficiencies of cmd.exe or any other shell you might run.
A Console can not "catch" the commands and store them in a file? This can not be done?
Console can catch input, but how does Console know which inputs are commands and which are inputs into a command line program asking for input? Console can't make any assumptions about what programs are using the console window. Sometimes it is a command shell, sometimes it is a program you launched from the command shell asking for user input, like an ssh session. Would you want Console storing your passwords as you enter it on the command line?
Having Console store a command history would be like asking xterm to store your command history. It's not really the right place.
But demand from command.com record the history of commands - it even sillier, is not it?
Well, very sorry that the history of commands will not… :(
I found very interesting way to keep commands history between console sessions - to use PyCmd as shell in Console. PyCmd adds some unix bash-like abilities to windows console. Have a lot of fun! :)
Powershell can save command history via Get-History and Export-Clixml, and reload history via Import-Clixml and Add-History.
You can then set saving history to trigger via Register-EngineEvent using the powershell.exiting event. An example is here: http://www.nivot.org/post/2009/08/15/PowerShell20PersistingCommandHistory.aspx
Unfortunately, for it to work properly, you have to exit Powershell with the exit command. Clicking the X doesn't work with this in either Console or the default windows console.
I'm wondering if Console could be made pass the "exit" command to any open Powershell tabs when the X is clicked on it? I don't know much about the codebase (yet), but I imagine this might be possible?
Log in to post a comment.