Skip to content

Conversation

@fdcote
Copy link
Contributor

@fdcote fdcote commented Oct 25, 2025

This PR introduces command history.

Navigation: Pressing the up and down arrow keys (customizable) in command mode cycles through previous commands.

Persistence: History is automatically saved across sessions.

Filtering: Typing the initial characters of a command filters the history for faster recall.

With filtering, this update also appears to resolve issue #63.

@freref
Copy link
Owner

freref commented Oct 26, 2025

This works great, thanks. Will make an issue to add ghost text in the future and I'm wondering if we should store it at ~/.fancy-cat_history, following the convention of other projects.

@fdcote
Copy link
Contributor Author

fdcote commented Oct 26, 2025

Ghost text would be neat!

Regarding the location of the history file, maybe we could base it on a flexible XDG approach for config and state files:

  1. Check to use the XDG locations if the relevant environment variables are set.
  2. If the variables are not set, use the standard fallback locations.
  3. Legacy locations are only used if a config file already exists there and no file exists in either the XDG or fallback locations.
XDG Fallback Legacy
Config $XDG_CONFIG_HOME/fancy-cat/config ~/.config/fancy-cat/config ~/.fancy-cat
History $XDG_STATE_HOME/fancy-cat/history ~/.local/state/fancy-cat/history ~/.fancy-cat_history

@freref
Copy link
Owner

freref commented Oct 26, 2025

Sounds good. You want to add that to this PR or as a future issue?

@fdcote
Copy link
Contributor Author

fdcote commented Oct 26, 2025

Perfect. I can add it to this PR in a little while.

@fdcote
Copy link
Contributor Author

fdcote commented Oct 29, 2025

I’ve included the logic for both the config and history file locations in this PR, as mentioned above.

@freref freref merged commit 33c1e2c into freref:master Oct 31, 2025
4 checks passed
@fdcote fdcote deleted the history branch November 1, 2025 17:00
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.

2 participants