Skip to content

feat: restore the last 10 commands per tab on reopen #50

Closed

Description

@arifintahu

Problem

EmberTerm restores tabs, splits and folders on reopen, but a restored shell starts with an empty history for that tab, so pressing Up recalls nothing from before the close.

Proposal

Remember the last 10 commands per pane in session.json and seed the new shell's own history with them on restore, so Up (and Ctrl+R) work natively.

  • Capture: the Git Bash / WSL / pwsh prompt hooks emit each new command as OSC 133;E;<percent-encoded>; Grid forwards it to a tabs-store updater that filters, caps at 10 and autosaves into SavedPane.history.
  • Restore: the list is passed to the new shell as env EMBER_HIST (newline-joined, same pattern as EMBER_CWD); the hook loads it into history on the first prompt.
  • SESSION_VERSION stays 1 (additive field).

Non-goals

  • cmd (no hook), multi-line commands, a history list/search UI, cross-tab history, a settings toggle.

Privacy

session.json is plaintext. Commands starting with a space or containing obvious secrets (token=, password:, Authorization, ...) are skipped. This is best effort, not a guarantee.

Acceptance

  • Run commands in a tab, close and reopen: Up shows them, newest first; a second close/reopen does not duplicate them.
  • Split panes keep separate lists.
  • A command like export TOKEN=x is not stored.
  • No visible slowdown of the first prompt in Git Bash.

Activity

  1. added
    enhancement
    on Nov 16, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions