feat(history): support N-th history index in substitution #2

Merged
rootiest merged 1 commits from feat/hist-sub into main 2026-04-30 22:27:30 +00:00

1 Commits

Author SHA1 Message Date
rootiest ed62c8c100 feat(history): add support for Nth history index in substitution
Extends the interactive history substitution function to support an
optional third field `old/new/index`.

- Keeps default behavior of targeting the most recent command (index 1).
- Allows targeting a specific history entry by appending a number.
- Validates that the index is a positive integer before attempting retrieval.
- Safely handles cases where the requested history index does not exist.

Example: 'cat/bat/5' now replaces 'cat' with 'bat' in the 5th previous command.
2026-04-30 18:18:31 -04:00