contour-terminal / endo

7 stars 0 forks source link

History file (command completion) #16

Open Yaraslaut opened 6 months ago

Yaraslaut commented 6 months ago

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 commented 6 months ago

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

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.