Skip to content

Recent commands UI #14779

Closed
Closed

Description

@KyodaiKen

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.

  1. User enters:

    backup f: n:\backups\computername\system
    format f:
    
  2. User closes terminal and maybe even reboots windows

  3. User opens terminal back up and can push the arrow up key to recall the last commands they have executed.

  4. User cannot find what they're searching for, so they type:

    history
    

    And 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 !1 or !0.
    With #0 the line pops up to be edited before executing with the RETURN key

Activity

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Feb 3, 2023
  2. added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    Needs-Tag-FixDoesn't match tag requirements
    on Feb 3, 2023
  3. zadjii-msft commented on Feb 3, 2023

    @zadjii-msft
    Member

    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.exe will 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

  4. KyodaiKen commented on Feb 3, 2023

    @KyodaiKen
    Author

    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!

  5. changed the title [-]Persistent command history[/-] [+]Recent commands UI[/+] on Feb 5, 2023
  6. added
    Area-SettingsIssues related to settings and customizability, for console or terminal
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    and removed
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Feb 5, 2023
  7. added a commit that references this issue on Aug 15, 2023
    e5a430f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsIssues related to settings and customizability, for console or terminalIn-PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.Needs-Tag-FixDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions