Commit graph

166 commits

Author SHA1 Message Date
Conrad Ludgate
bb7f00dbef
chore: use fork of skim (#803)
* use fuzzy-matcher instead of skim

switch to a search-engine abstraction

* fmt

* fix deprecated warnings
2023-03-26 15:47:38 +01:00
Steven Xu
a7cb21a51b
feat: add *Nushell* support (#788)
* feat: add *Nushell* support

* refactor: use `sh` to swap `STDOUT` and `STDERR` instead of using a temporary file

* feat: include both keybindings, with the current REPL buffer passed to *Atuin*'s

* feat: don't record commands run by keybindings
2023-03-26 15:44:06 +01:00
Patrick Decat
13ce5f746c
feat: add an inline view mode (#648)
* add inline viewport

* Add inline_height setting. Zero disables inline mode (the default)
2023-03-25 17:27:20 +00:00
Patrick Decat
03f7e5543e
Respect exit_mode setting when exiting with arrow down keypress (#807) 2023-03-25 16:06:10 +00:00
Ellie Huxtable
79622cf698
Delete all instances of a command (#797)
* Delete all instances of a command

Our search command will de-dupe results by default. But... This isn't
great for deleting! You don't want to run it over-and-over-and-over
until all commands are deleted.

Loop the query, and keep on deleting what it returns until they are all
gone.

* Optimize delete upload

It was running a request for every element, on every sync lol

Only push a delete if needed

Future: push all deletes in one request
2023-03-24 09:04:57 +00:00
Conrad Ludgate
ba1d615f5e
chore: remove tui vendoring (#804) 2023-03-23 09:19:29 +00:00
Krut Patel
378be6b790
Allow changing search_mode during interactive search (#586)
* Make search_mode a part of SearchState

* Allow changing search mode using ctrl+s

* Tweak state reset for switched_search_mode

* Improve search_mode display in interactive mode

* Incorporate review suggestion

* Tweak language

* Fix Clippy and format
2023-03-22 16:16:59 +00:00
Hamza Hamud
26a1b93098
fix: paste into terminal after switching modes (#793)
* fix: paste into terminal after switching modes

* fix: remove collect and fix format
2023-03-20 18:08:29 +00:00
Ellie Huxtable
dcd77749dd
Add history deletion (#791)
* Drop events. I'd still like to do them, but differently

* Start adding delete api stuff

* Set mailmap

* Delete delete delete

* Fix tests

* Make clippy happy
2023-03-20 09:26:54 +00:00
Conrad Ludgate
edcd477153
skim-demo (#695)
* skim-demo

* skim some more

* Weight first word match higher (#712)

* some improvements

* make skim opt-in

---------

Co-authored-by: Frank Hamand <frankhamand@gmail.com>
2023-03-19 20:49:57 +00:00
Patrick Decat
efd2230eba
Prefer PWD environment variable over cwd if available to better support symbolic links (#783) 2023-03-14 23:15:39 +00:00
YummyOreo
88deec31c8
Fixes a bug on windows (#780)
* Fixes the windows double input issue instead of the patchy way

* clippy allow
2023-03-14 11:47:24 +00:00
Conrad Ludgate
0dc918e8e5
add common prefixes and subcommands to stats (#773)
* add common prefixes and subcommands to stats

* fmt
2023-03-13 22:42:54 +00:00
Conrad Ludgate
1638cb57cb
fix new stats unique count (#772) 2023-03-09 09:47:22 +00:00
Ellie Huxtable
b91d4f4806
Fix before/after combined with limit (#770)
* Fix before/after combined with limit

Mixing filters done in Rust with filters done in SQL is _no bueno_.

Been meaning to do this for a while anyways. Search params are getting a
bit fat but oh well!

* Make an excuse for a big function sig

* Do options map_or not if

* Fix tests
2023-03-08 23:45:14 +00:00
Luke Karrys
ca5bbea0d4
fix(client): always read session_path from settings (#757)
* fix(client): always read session_path from settings

* fixup! fix(client): always read session_path from settings

* fixup! fix(client): always read session_path from settings
2023-03-06 22:46:03 +00:00
YummyOreo
e9c5e1d85c
Windows support (#754)
* 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-05 19:00:59 +00:00
Steven Xu
2e79e73af3
feat: add common default keybindings (#719)
* feat: add common default keybindings

* feat: add `WORD_SEPARATORS` to config as `word_chars`, as this is what *Zsh* calls it

* feat: add option for *Emacs* word jumping

* feat: scroll with `PageUp` and `PageDown`, cf #374
2023-03-05 18:49:09 +00:00
Ellie Huxtable
3eb50a8383
Up arrow filter_mode setting default to global filter mode (#758)
Resolves #756
2023-03-05 18:43:03 +00:00
Patrick Decat
24388033a5
Show preview of selected command (#643)
* Only show help if terminal strictly has more than one line

* There is no border around the input line in compact mode

* Add command preview

* Dynamic preview height

* Avoid extra allocations

Co-authored-by: Conrad Ludgate <oon@conradludgate.com>

* Address clippy error

* Merge normal and compact views code

* Add show_preview setting, disabled by default

* Convert `bool` to `int` with `if` for legibility

---------

Co-authored-by: Conrad Ludgate <oon@conradludgate.com>
2023-03-05 18:36:35 +00:00
cyqsimon
b80f91c6a2
Disable 2 tests that shouldn't run in release mode (#736)
These tests expect `debug_assert!` to panic:
- `pos_of_panics_on_out_of_bounds`
- `index_of_panics_on_out_of_bounds`
2023-02-27 16:31:27 +00:00
Ellie Huxtable
fe5f728aa6
Release v13 (#727)
* Write release blog post

* Bump versions

* Update contributors
2023-02-26 21:22:29 +00:00
Ellie Huxtable
5f2db5b93e
Revert "Remove shortcut numbers (#708)" (#724)
This reverts commit 3fdd4f4591.
2023-02-24 15:49:05 +00:00
Ellie Huxtable
3fdd4f4591
Remove shortcut numbers (#708)
* Remove shortcut numbers

I was also going to remove the offset so scrolling only happens at the
top. But tbh, I quite like it this way.

* Remove key binding
2023-02-15 09:08:39 +00:00
Tobias Hunger
7e7dd63966
fish: Fix atuin init for the fish shell (#699) 2023-02-14 22:21:22 +00:00
Ellie Huxtable
1f7d3a34e7
Check before unwrapping in stats (#717)
Should fix the error @pdecat found!
2023-02-14 09:45:55 +00:00
Johannes Baiter
5cb43772dc
Add history_filter cfg to exclude commands from history (#515) (#716)
Adds a new `history_filter` setting through which users can specify a
list of regular expressions that match commands that should not be
recorded in the history.
2023-02-14 07:14:05 +00:00
Trygve Aaberge
2cec7ba677
Allow using existing key file on login (#688)
* Allow logging in without overwriting existing key file

If the given key on login in empty, keep the existing key file rather
than overwriting it with an empty file. This is useful if you log out
and want to log in again and still use the same key, or if you have
copied over the key file rather than providing it as input.

* Refuse logging in if key is empty

Before the previous commit, an empty key file would be created if key
wasn't specified, and after the previous commit, the key file would not
be created if the key wasn't specified and stay empty if it was empty.

Now the log command checks the key file if a key is not specified and
exits with an error message if either the key file couldn't be opened or
is empty. If a key is specified, the key file is just created with it as
before.

* Validate the key on login, create new if no exists

After reading the key either from an existing key file, or from the user
input, validate that the provided key is valid (rather than just
checking that it isn't empty). If no key file exists, create a new key
instead of erroring out.
2023-02-10 19:35:38 +00:00
Conrad Ludgate
deb7c19093
stats (#707) 2023-02-10 18:58:02 +00:00
Ellie Huxtable
2672f78dda
make update_needed check lazy (#706) 2023-02-10 18:14:48 +00:00
Conrad Ludgate
edda1b741a
crossterm support (#331)
* crossterm v2

* patch crossterm

* fix-version

* no more tui dependency

* lints
2023-02-10 17:25:43 +00:00
Conrad Ludgate
5611bc59f5
display mnemonic key (#694) 2023-02-06 19:22:58 +00:00
Ellie Huxtable
3abc96fafe
Try to make clippy happy 🥺 (#686)
* Try to make clippy happy 🥺

* Fmt

* I missed one (can't run clippy locally on airport wifi...)
2023-02-06 11:59:01 +00:00
Baptiste
893a395f12
feat(history): Add new flag to allow custom output format (#662)
* feat(history): Add new flag to allow custom output format

* more efficient formatting

* add user and host

* docs

Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
2023-01-26 10:57:52 +00:00
Ellie Huxtable
a8ed8f1325
Update contributors.rs
sorry @conradludgate 😭
2023-01-24 19:50:51 +00:00
Baptiste
582189336d
chore(#621): Exit atuin when pressing down arrow on most recent entry (#659)
Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>
2023-01-10 22:46:33 +00:00
Jamie Quigley
a5616aea8f
Rework atuin init (#652)
* Rework `atuin init`

This allows users to disable the CTRL-R and Up Arrow bindings,
independently from one another

* Document --disable-{ctrl-r,up-arrow}

* Apply suggestions from code review

Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>

Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2022-12-24 17:18:44 +00:00
Patrick Decat
ed394afa82
Allow overriding filter and search modes from CLI (#635)
* Allow overriding filter and search modes from CLI arguments

* Use session filter mode for bash up key binding

* We precisely do not want to add quotes here so that all arguments are properly passed

* Add --shell-up-key-binding hidden command argument and filter_mode_shell_up_key_binding configuration option to allow customizing the filter mode used when atuin is invoked from a shell up-key binding

* Correct up binding for zsh

Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2022-12-18 18:26:09 +00:00
Ellie Huxtable
4c6a287f4d
Switch to using ATUIN_LOG instead of RUST_LOG (#642)
* Switch to using ATUIN_LOG instead of RUST_LOG

* Stop clippy complaining

* I should know better - clippy is never happy :(
2022-12-16 18:37:45 +00:00
Patrick Jackson
5b22f29329
Fix session history (#620) 2022-12-16 17:15:27 +00:00
Patrick Decat
1d9ce94f96
Add support for some additional keys in interactive mode (#634)
* Ignore tab key in interactive mode

* Support home and end keys in interactive mode

* Support delete key in interactive mode
2022-12-03 10:51:15 +00:00
Patrick Jackson
478af1fa0f
Handle multiline commands in fish shell (#623) 2022-11-19 21:05:25 +00:00
Ellie Huxtable
f38ef12581
Release v12 (#599)
* Release v12

* Add new contributors
2022-11-06 15:30:21 +00:00
Sam Lanning
4768b16b74
Add setting for keeping typed query when exiting (#451)
* Add option for keeping typed query on escape

fixes #422

* chore: Address duplicate if statement blocks
2022-11-06 07:34:14 +00:00
Sam Lanning
d87abbd3dc
fix #596: Avoid drawing a command section beyond the width of the list (#597)
* fix #596: Avoid drawing a command section beyond the width  of the list

* chore: remove unneeded parentheses
2022-11-06 07:32:35 +00:00
Ellie Huxtable
e297b98f72
Add local event log storage (#390)
* Add event data structures

This adds the data structures required to start syncing events, rather
than syncing history directly.

Adjust event

Fix

Add event data structure to client

* Add server event table sql

* Add client event table migration

Adjust migration

* Insert into event table from client

* Add event merge function

Right now this just ensures we have the right amount of events given the
history we have

BUT it will also be used to merge CREATE/DELETE events, resulting in
history being deleted :)

* Make CI happy

* Adjust

* we don't limit history length any more

* Update atuin-client/src/database.rs

Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>

* fix usage

* Fix typo

* New Rust, new clippy stuff

Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
2022-11-04 09:08:20 +00:00
TymanWasTaken
6e3304b485
Exit with return code 1 when no results are found in atuin search command (#489)
* Exit with return code 1 when no results are found in `atuin search` command

* Remove random whitespace
2022-11-02 20:47:16 +00:00
Benjamin Vergnaud
8b9aae7076
docs: add more details about date parsing in the stats command (#579)
* docs: add more details about date parsing in the stats command

* chore: Replace chrono-english crate with interim
2022-10-21 20:21:14 +01:00
Patrick Jackson
90d089c73e
Respect fish shell's builtin private mode (#577) 2022-10-21 06:35:40 +01:00
Conrad Ludgate
5e2c438dab
Upgrade clap (#568) 2022-10-18 09:50:22 +01:00