This PR enhances the interactive history substitution function (Ctrl+F) to support an optional history index.
Changes:
N-th History Support: You can now use the syntax old/new/index (e.g., foo/bar/3) to perform substitution on the 3rd most recent command in history.
Improved Robustness: Added checks to ensure the target command exists before attempting replacement.
Sudo Fallback: Maintained existing behavior where an empty command line prepends sudo to the last command.
Verified with local testing.
This PR enhances the interactive history substitution function (`Ctrl+F`) to support an optional history index.
### Changes:
- **N-th History Support:** You can now use the syntax `old/new/index` (e.g., `foo/bar/3`) to perform substitution on the 3rd most recent command in history.
- **Improved Robustness:** Added checks to ensure the target command exists before attempting replacement.
- **Sudo Fallback:** Maintained existing behavior where an empty command line prepends `sudo` to the last command.
Verified with local testing.
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR enhances the interactive history substitution function (
Ctrl+F) to support an optional history index.Changes:
old/new/index(e.g.,foo/bar/3) to perform substitution on the 3rd most recent command in history.sudoto the last command.Verified with local testing.