Skip to content

Support importing from replxx history files#2024

Merged
ellie merged 3 commits intoatuinsh:mainfrom
amosbird:import_from_replxx
May 21, 2024
Merged

Support importing from replxx history files#2024
ellie merged 3 commits intoatuinsh:mainfrom
amosbird:import_from_replxx

Conversation

@amosbird
Copy link
Contributor

As discussed in Discord, this feature should be useful for managing history of applications which use https://github.com/AmokHuginnsson/replxx . One notable example would be ClickHouse.

I'll try to integrate atuin into clickhouse-client later.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

@amosbird amosbird force-pushed the import_from_replxx branch from 0b403b9 to e3faa0d Compare May 16, 2024 06:35
Also Remove auto-detect for replxx which makes no sense.
@ellie
Copy link
Member

ellie commented May 18, 2024

Thank you! Would it be possible to get some test cases for this please?

@amosbird
Copy link
Contributor Author

Sure. Tests have been added.

Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you! :shipit:

@ellie
Copy link
Member

ellie commented May 21, 2024

Seeing as this is your first time contributing, if you would like a holographic contributors-only Atuin sticker, then please fill out this form!

We do also have a Discord if you'd like to ask any questions, or just fancy hanging out!

@ellie ellie merged commit 413d3e3 into atuinsh:main May 21, 2024
@amosbird
Copy link
Contributor Author

if you would like a holographic contributors-only Atuin sticker, then please fill out this form!

That sounds perfect! I've completed the form.

ellie pushed a commit that referenced this pull request Dec 3, 2025
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->

The original implementation of the `replxx` importer, from PR #2024,
only supported `.histfile` as a filename for the history file, since
there is no default filename. However, the replxx codebase does use
`replxx_history.txt` as an example history filename (see
[here](https://github.com/AmokHuginnsson/replxx/blob/release-0.0.4/examples/c-api.c#L183)
and
[here](https://github.com/AmokHuginnsson/replxx/blob/release-0.0.4/examples/cxx-api.cxx#L383)),
so this patch adds support for that as an alternative filename.

The implementation was modeled after [the
one](https://github.com/atuinsh/atuin/blob/v18.10.0/crates/atuin-client/src/import/zsh.rs#L29-L44)
currently used for the `zsh` history file importer, which also means the
`replxx` importer now produces a human-friendly error if no history file
is found in the expected path(s).

## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing

/cc @amosbird who introduced this importer in #2024.
BinaryMuse pushed a commit that referenced this pull request Jan 16, 2026
Recreation of PR atuinsh/docs#111, after the
migration of the docs to this repo (#3018).

Copying the description from that PR, for convenience:

This PR implements a few improvements to the import doc page.

1. **Fix name of `zsh-hist-db` and `xonsh-sqlite` subcommands**

   The `atuin import` subcommands `zsh-hist-db` and `xonsh-sqlite`
were incorrectly documented as `zsh_histdb` and `xonsh_sqlite`,
respectively.

This is likely due to the actual modules that implement the import
functionality
being indeed named `zsh_histdb` and `xonsh_sqlite` (see
[here](https://github.com/atuinsh/atuin/blob/v18.10.0/crates/atuin/src/command/client/import.rs#L14)
and
[here](https://github.com/atuinsh/atuin/blob/v18.10.0/crates/atuin-client/src/import/mod.rs#L19-L21)),
but for the end-user, that results in documentation that's confusing at
best,
   and error-inducing at worst.

Fixes issue
[#2533](#2533).

2. **Document the `powershell` and `replxx` import subcommands**

These importers were introduced in PRs
[#2864](#2864) and
[#2024](#2024),
respectively,
   but the documentation was not updated to account for them.

3. **Fix alphabetic sorting of sections**

Move the `nu-hist-db` and `zsh-hist-db` sections to be after `nu` and
`zsh`, respectively.
This is more intuitive, and matches the existing sort used for the
`xonsh` / `xonsh-sqlite` sections.

4. **Minor whitespace correction**

   Fix line wrapping in the `resh` section
   ~~and remove trailing whitespace in the `nu*` sections.~~

<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->

## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing

Fixes #2533.
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