Skip to content

Add persistent terminal aliases - #28

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/terminal-emulation-feature-6fb9
Draft

Add persistent terminal aliases#28
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/terminal-emulation-feature-6fb9

Conversation

@cursor

@cursor cursor Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Issue

Problem

The terminal UI advertises an alias command, but the current implementation only prints a hard-coded example. That leaves a gap in the site's terminal-emulation goal: visitors cannot create shortcuts, inspect aliases, or remove them like they would in a real shell.

Proposed improvement

Add persistent, shell-style alias management to the browser terminal. Aliases should be stored client-side, expand before command execution, preserve additional arguments, work with supported pipelines, and include loop protection.

Acceptance criteria

  • alias lists saved aliases and explains how to create one when none exist.
  • alias name='command' creates or replaces an alias.
  • alias name prints one alias or a not-found error.
  • unalias name removes an alias; unalias -a clears all aliases.
  • Alias names participate in tab completion and which reports alias definitions.
  • Aliases persist across page reloads using localStorage.
  • Recursive aliases are rejected with a clear loop error.

Changes

  • Added alias parsing, formatting, normalization, and expansion helpers in src/lib/terminal/index.js.
  • Wired persistent alias storage/execution into src/scripts/terminal.js, including pipeline aliases and which/tab-completion support.
  • Added unalias to the command surface and help/man documentation.
  • Documented alias usage in README.md.
  • Added focused Vitest coverage for alias parsing, formatting, expansion, and loop detection.

Validation

  • pnpm test -- tests/unit/terminal.test.js passed: 71 tests.
  • Pre-push pnpm check passed: lint, format check, coverage, and Astro build.
  • Manual browser walkthrough passed and was recorded: <video src="/opt/cursor/artifacts/persistent_terminal_aliases_walkthrough.mp4" controls></video>
Open in Web View Automation 

Co-authored-by: Jakob Langtry <jjalangtry@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant