Repository navigation
Description
Description of the new feature/enhancement
In Linux, almost every terminal stores a persistent history of commands. I think in this case it's the interpreter like bash or zsh. But I think it should be possible to do it on app level per user as well.
Proposed technical implementation details (optional)
A simple SQLite DB file per user and per command interpreter (cmd, powershell, etc.) that stores the history of commands could be used. The location should be configurable in the preferences JSON.
-
User enters:
backup f: n:\backups\computername\system format f: -
User closes terminal and maybe even reboots windows
-
User opens terminal back up and can push the arrow up key to recall the last commands they have executed.
-
User cannot find what they're searching for, so they type:
historyAnd sees a list like this:
0 2022-02-03 14:33: backup f: n:\backups\computername\system 1 2022-02-03 14:43: format f:And can redo the command using
!1or!0.
With#0the line pops up to be edited before executing with theRETURNkey
Activity
zadjii-msft commentedon Feb 3, 2023
Sorry, this is just something that's got to be a feature of the shell (
cmd.exe,pwsh,bash, etc) itself. PowerShell has supported this for some time via PsReadline, as do most other moder shells. Alas,cmd.exewill never be able to be changed to add this feature.Now I had an idea in mind that might help mitigate this. It'd be a little wonky, but it would persist your command history regardless of shell. And since I don't really have a thread I'm already using for tracking that, I'm tempted to hijack this thread for that purpose.
My solution wouldn't be a CLI feature - it'd be build directly into the Terminal, and the history would be exposed via a UI element in the Terminal. You okay with me re-purposing this thread?
x-link #13445
KyodaiKen commentedon Feb 3, 2023
That sounds nice! I actually proposed to add it to the Terminal app itself, I wouldn't have posted it here. You can of course hijack this thread. Let's see how it goes!
[-]Persistent command history[/-][+]Recent commands UI[/+]Add Suggestions UI & experimental shell completions support (#14938)
Add support for opening the Suggestions UI with recent commands (#14943)