aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-common/src/utils.rs (unfollow)
Commit message (Collapse)Author
2024-04-18chore: move crates into crates/ dir (#1958)Ellie Huxtable
I'd like to tidy up the root a little, and it's nice to have all the rust crates in one place
2024-04-03perf(dotfiles): cache aliases and read straight from file (#1918)Ellie Huxtable
* cache aliases when set locally * handle rebuild on sync and tidy things a bit * support all shells except nu * make clippy happy * fmt * fix for no features
2024-02-05chore(ci): run rust build/test/check on 3 platforms (#1675)Ellie Huxtable
* chore(ci): run rust build/test/check on 3 platforms * need to properly test windows * do not need to strip here, and windows has a suffix anyway
2024-01-29Add xonsh support (#1375)Matthieu LAURENT
* Add basic xonsh support * Add init xonsh command * Add Xonsh install instructions in docs * Add xonsh ctrl-R search * update xonsh script and instructions Summary of changes: * Added duration to postcommand hook * Switched main search operation to use `subproccess.run()` rather than running as an xonsh shell command - this a) allows us to capture stderr without needing a temporary file and b) avoids a weird broken-buffer state that results from running a fullscreen TUI and then programmatically editing the buffer * Added support for immediately executing chosen command via `__atuin_accept__:` (like bash/zsh/fish) * strip newline from command before sending to atuin * Add basic xonsh support * Add init xonsh command * Add xonsh ctrl-R search * Remove advanced-install guide (was accidentally re-added during rebase) * Clean up Xonsh doesn't import private functions into the local namespace when sourcing a file * Add xonsh ro readme * Respect ATUIN_NOBIND * Format with black, and improve PEP8 compliance * Add up search * Format rust code --------- Co-authored-by: Joseph Montanaro <jfmonty2@gmail.com>
2024-01-18Escape control characters using caret notation (#1585)Peter Holloway
Instead of using their equivalent hex codes.
2024-01-17Stop control characters being printed to terminal (#1576)Peter Holloway
If a previous command in the history contained a literal control character (eg via Ctrl-v, Ctrl-[), when the command was printed, the control character was printed and whatever control sequence it was part of was interpreted by the terminal. For instance, if a command contained the SGR sequence `^[[31m`, all subsequent output from `atuin history list` would be in red. Slightly less of a problem, control characters would also not appear in the interactive search widget although they would be printed when selected. This meant `echo '^[[31foo'` would appear as `echo '[31foo'`. When the entry was selected, the same problem as before would occur and, for the example above, `echo 'foo'` would be printed with 'foo' in red. When copied, this command would not behave the same as the original as it would be missing the control sequence. This adds an extension trait to add a method to anything that behaves like a string to escape ascii control characters and return a string that can be printed safely. This string can then be copied and run directly without having to add the control characters back.
2023-12-16chore(deps): uuidv7 stable (#1451)Conrad Ludgate
2023-10-21Add bash support to `enter_accept` (#1316)Ellie Huxtable
2023-10-20Add fish support for `enter_accept` (#1315)Ellie Huxtable
* Add fish support for `enter_accept` Also fixes shell detection. Who trusted me to write jetlagged code last night huh? * Document
2023-10-20Add enter_accept to immediately execute an accepted command (#1311)Ellie Huxtable
* make enter execute the command, tab copy it * Add config for enter_accept enter_accept will make Atuin immediately accept an execute a command when selected. It defaults to false in our binary, but the default config enables it. This means that users who already use atuin will not default to the new behaviour unless they opt in, but new users will have it by default. Thanks to @davidhewitt for the patch and bulk of this implementation! Currently we have it just for zsh, but I'll follow up with other shells (unless anyone beats me to it :D) * Add docs * we need to tidy up the ui code anyway * Check if using zsh * Update docs/docs/config/config.md Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> --------- Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
2023-09-11replace chrono with time (#806)Conrad Ludgate
* replace chrono with time * Fix test chrono usage --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2023-08-30Run formatting (#1202)Ellie Huxtable
2023-07-14Add workspace mode, enable if in git repo (#1053)Ellie Huxtable
* Add workspace mode, enable if in git repo * Fix tests * Should now be good * Page filter modes correctly if in workspace
2023-04-11Switch to uuidv7 (#864)Ellie Huxtable
* Add uuid_v7 * Actually use the new uuid * Add a test to ensure all uuids are unique, even in a tight loop * Make clippy happy
2023-03-26chore: use fork of skim (#803)Conrad Ludgate
* use fuzzy-matcher instead of skim switch to a search-engine abstraction * fmt * fix deprecated warnings
2023-03-14Prefer PWD environment variable over cwd if available to better support ↵Patrick Decat
symbolic links (#783)
2023-03-05Windows support (#754)YummyOreo
* adds support for getting home dir in windows * fixes bug * adds windows server support + build for linux ^| todo: test server on linux * improvements to redability * removes comment * returns if windows when importing auto * this should be here, to prevent double inputs * adds explanation to why we have to throw away 1 event in the tui * better message when running atuin import on windows + spell fix
2023-03-02Fix race condition in directory tests (#748)cyqsimon
2022-04-25history list (#340)Conrad Ludgate
2022-04-22Bump uuid from 0.8.2 to 1.0.0 (#311)dependabot[bot]
* Bump uuid from 0.8.2 to 1.0.0 Bumps [uuid](https://github.com/uuid-rs/uuid) from 0.8.2 to 1.0.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/0.8.2...1.0.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * patch Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
2022-04-22refactor (#327)Conrad Ludgate
2022-04-13Initial implementation of calendar API (#298)Ellie Huxtable
This can be used in the future for sync so that we can be more intelligent with what we're doing, and only sync up what's needed I'd like to eventually replace this with something more like a merkle tree, hence the hash field I've exposed, but that can come later Although this does include a much larger number of count queries, it should also be significantly more cache-able. I'll follow up with that later, and also follow up with using this for sync :)
2021-05-10Re-add macro_use to atuin-common (#107)Ellie Huxtable
* Re-add macro_use to atuin-common When build as a dependency, the macro is available from another crate. When you try to build common by itself, the macro is not found. Magic, huh? * chore: remove unneeded use - clippy is confused Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
2021-05-09fix some bugs (#90)Conrad Ludgate
* fix some bugs * format
2021-04-25Update docs, unify on SQLx, bugfixes (#40)Ellie Huxtable
* Begin moving to sqlx for local too * Stupid scanners should just have a nice cup of tea Random internet shit searching for /.env or whatever * Remove diesel and rusqlite fully
2021-04-20Use cargo workspaces (#37)Ellie Huxtable
* Switch to Cargo workspaces Breaking things into "client", "server" and "common" makes managing the codebase much easier! client - anything running on a user's machine for adding history server - handles storing/syncing history and running a HTTP server common - request/response API definitions, common utils, etc * Update dockerfile
2021-04-13Add history sync, resolves #13 (#31)Ellie Huxtable
* Add encryption * Add login and register command * Add count endpoint * Write initial sync push * Add single sync command Confirmed working for one client only * Automatically sync on a configurable frequency * Add key command, key arg to login * Only load session if it exists * Use sync and history timestamps for download * Bind other key code Seems like some systems have this code for up arrow? I'm not sure why, and it's not an easy one to google. * Simplify upload * Try and fix download sync loop * Change sync order to avoid uploading what we just downloaded * Multiline import fix * Fix time parsing * Fix importing history with no time * Add hostname to sync * Use hostname to filter sync * Fixes * Add binding * Stuff from yesterday * Set cursor modes * Make clippy happy * Bump version