atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.13k stars 543 forks source link

Are there instructions to use atuin with alternative shells ? (xonsh) #1027

Closed StitiFatah closed 1 year ago

StitiFatah commented 1 year ago

Hey,

Have been using atuin with zsh for a couple of months, I must say it's a very convenient piece of software, thanks for that, I'm now trying out the xonsh shell and was wondering if there were generic instructions for shells that don't have an atuin init $SHELL

Thanks in advance

rirze commented 1 year ago

Looking for something similar with ion-shell

ellie commented 1 year ago

Hey! There are not, as it varies significantly by shell + depends on the hooks available. If we had instructions, we would just implement the shell plugin and include it

rirze commented 1 year ago

Are there any guidelines? I'd love to open a PR with support if there was some documentation for what needs to be minimally implemented.

arcuru commented 1 year ago

The best way to understand what's necessary would be to look at the most recent shell support PR, #788

New shells are implemented by writing an import module to convert the existing history from the shell, see the others here.

And writing shell hooks scripts, existing ones here. These scripts are what atuin uses for atuin init <shell>. Not all shells support the hooks necessary for atuin though. nushell, for example, didn't support the necessary hooks and actually needed them added before atuin could be supported.

Looking at their docs I don't think ion-shell supports any hooks at all, which means it's not possible to integrate with atuin.

I was confused by the xonsh docs, so I can't tell if that supports hooks. You'd need to ask them.

Matthieu-LAURENT39 commented 10 months ago

Did this ever get implemented? Looking into using atuin with xonsh as well

arcuru commented 10 months ago

Nothing has been done in Atuin.

Taking a second look, this can definitely be implemented using Events in xonsh: https://xon.sh/tutorial_events.html. They do support the necessary hooks that Atuin would need, on_precommand() and on_postcommand().

If you're familiar with xonsh I expect it would be fairly easy if you'd like to implement it. I've been trying out some different shells lately and had been meaning to checkout xonsh, so I may get to it myself at some point.

Matthieu-LAURENT39 commented 10 months ago

I was thinking of implementing it, i just wanted to check if it was done already to not reinvent the wheel. I'll try to make a PR this weekend.

arcuru commented 10 months ago

Awesome! If you have any questions, the Atuin discord is fairly active and would be happy to help from the Atuin side :)

anki-code commented 7 months ago

1375