-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Remember Command History #6500
Comments
This is the shell's job. PoweerShell and Bash (and zsh, fish, ...) already do this! The terminal can't do anything about shells that cannot save their history. Sorry! |
This feature request should be re-enabled. This is a legitimate feature request. You can't think of a way to write a program which just remembers history and passes the commands to a cmd shell? |
@mcgov |
This is going to sound crazy but I'd like to have this feature in windows terminal |
You already have src/host/history.cpp and src/host/history.h, for programs like cmd.exe or netsh.exe that don't implement their own line editing. Surely it would be technically possible to make the console host save and restore this history, or extend the pseudoconsole channel to let WindowsTerminal.exe do it. |
The console host maintaining an application’s history is an architectural mistake the likes of which we are not intending to make again. |
That includes extending it in any way that would make it more enticing or more featureful such that an application would prefer to use it over its own line editing and history management. We maintain that code because we have to, not because it was good or worthwhile. |
You can use https://mridgers.github.io/clink/ |
I daily drive pwsh, so I don't exactly need cmd's history but I'd like to see this bit of code in action..
|
Sorry, still foggy from the holidays. Re:
Could you elaborate? Which feature toggle? |
@zadjii-msft, KalleOlaviNiemitalo had said:
But I couldn't find references of this setting/toggle.. |
I mean, it's not really a "terminal" feature, so to speak. It's an artifact of the console API. If a console application enables ENABLE_PROCESSED_OUTPUT (e.g., |
@NewtonChutney if you run cmd.exe in conhost (with or without Windows Terminal), and type a few commands, then you can use the up and down arrow keys to revisit those commands; that uses the history feature that is implemented in those files. There is also some function key that pops up a menu based on this history; that is implemented in some other part of conhost. The console API can manipulate the history programmatically and IIRC the DOSKEY command uses those functions. |
Ahhh, those files were related to session history.. Sorry for misinterpreting them as cross-session history handling.. ᓚᘏᗢ |
IIUC, it would be possible to fork conhost from this repository, add the history save/restore feature, install the binary in Windows, and register it as DelegationConsole so that Windows runs it when you start a console application. Even if Microsoft won't accept a pull request with such a change. If you changed its CLSID, then it would be installable side by side with openconsole of Windows Terminal, and would be able to launch Windows Terminal for the UI. |
Just like in Linux how can Terminal (for CMD.exe) remember the command line history across multiple instances. It is very frustrating to type commands again.
The text was updated successfully, but these errors were encountered: