Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History file (command completion) #16

Open
Yaraslaut opened this issue Dec 19, 2023 · 1 comment
Open

History file (command completion) #16

Yaraslaut opened this issue Dec 19, 2023 · 1 comment
Labels
enhancement New feature or request part:language-server part:prompt Command line prompt and input handling

Comments

@Yaraslaut
Copy link
Member

For the history other shells are using different ways to store history,
for example for fish this is $HOME/.local/share/fish/fish_history file with entries like

- cmd: clear
  when: 1702971673

for zsh file $HOME/.zsh_history with entries

: 1690200654:0;git clean -fdx

for bash file $HOME/.bash_history with entries

ll (just a command)

I think that in endo we should not create any files directly in $HOME directory but use something similar to fish. Also what I think might be good is to be able to merge history files between different machines either automatically or with some provided script, for example some of the tools for shell history like atuin provide synchronization via server

@christianparpart
Copy link
Member

I agree on the merging part, also, if I remember correctly, the location should be $XDG_DATA_HOME/contour/history then, which would by default be ~/.local/share/contour/history.

If you want the history to be synchronized/merged between machines, it should at least also be true for multiple endo processes on the same machines (in realtime).

Metadata attached to a history entry

  • command itself (obviously)
  • when it was created / last used
  • last exit status
  • machine and working directory this command was last issued on

i think machine and working directory are important to know in order to better prioritize command completion suggestions

The same applies for the exit status. If this was a bad exit code; e.g. 127, then I do not want to keep seeing that command as first suggestion, something that keeps happening to me in fish for example.

@christianparpart christianparpart added enhancement New feature or request part:prompt Command line prompt and input handling labels Dec 19, 2023
@christianparpart christianparpart changed the title History file History file (command completion) Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request part:language-server part:prompt Command line prompt and input handling
Projects
None yet
Development

No branches or pull requests

2 participants