Commit Graph

115 Commits

Author SHA1 Message Date
Jacob Evan Shreve
0f77f8ae72
Fix compatability with fish vi key bindings (#541)
PR #420 addressed the existence of pagination in a fish prompt by trying
to track when pagination was enabled and disabled. This introduced
atuin-specific bindings for common keys: `\t`, `\e`, `\r`, and `\n`
which exports a variable and informs the `_autiun_search` function to
not show the TUI.

Fish has a commandline function that will instead tell you whether
pagination is enabled so the user doesn't need to keep track of that
state. This PR uses this function, `commandline -P` to replace the prior
TUI supression scheme. Removing these extra function calls allows us to
remove the additional bindings which were breaking fish vi key bindings.

Replacing the value for `bind -M insert \e` completely breaks vi mode by
blocking the user from exiting insert mode. By removing these extra
binds, this PR restores fish vi mode compatability.
2022-10-07 20:31:30 -07:00
Ellie Huxtable
634b3e375f
Add contributors command (#550)
Inspired by the ClickHouse system contributors table, I thought this is
a nice extra way to say thank you to all those who put time and energy
into our project
2022-10-04 21:56:49 -07:00
c-14
f93da455a3
Clear RBUFFER when accepting output from atuin (#545)
Since we pass $BUFFER to atuin search, retaining RBUFFER (the part of
the buffer to the right of the cursor) probably doesn't make sense. The
advantage of setting RBUFFER and LBUFFER separately instead of setting
BUFFER is that the cursor is positioned after the end of LBUFFER instead
of remaining where it was before atuin was called.
2022-09-25 09:13:38 -07:00
c-14
045c87fbcd
Allow stateless commands to be run without config/database (#544)
* Allow stateless commands to be run without config/database

Fixes an issue where gen-completions fails trying to create a config
directory in restrained build environments/distribution.

* move non-db commands up to core subcommands

* re-add lost lines

* re-add lost lines

Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
2022-09-25 11:15:33 +01:00
Conrad Ludgate
db2a00f456
custom history list (#524)
* use custom list impl

* fmt

* segment

* clean up

* fix offsets

* fix scroll back space

* small touch ups
2022-09-12 20:39:41 +01:00
Conrad Ludgate
e8c8415278
update default layout (#523)
* update layouts

* add other duration changes

* fmt :(
2022-09-12 20:19:22 +01:00
Conrad Ludgate
702a644f68
better cursor search (#473)
* improve cursor code

* proper unicode support

* refactor and test

* fmt

* clippy

* move methods to state

* refactor search modules
2022-09-11 16:24:16 +01:00
Conrad Ludgate
474170fd90
hide errors for #516 (#518) 2022-09-01 09:07:10 +00:00
Jamie Quigley
aa556fa088
Fix atuin crashing on commands that start with -- (#509)
The use of `--` in the shell scripts prevents clap attempting to parse
the command name as a flag, in the case that it starts with `--`.
2022-08-23 17:26:42 +01:00
Frank Hamand
ab994e3c82
Batch key handling (#448)
* Batch input events and only query once they are finished

This simplifies the code a lot (no more bounded channel) and yields
the same performance improvement with scroll wheel spam while fixing copy/paste

* Clippy

* fmt

* Use blocking wait before emptying events channel

This was causing a busy loop

* Update query on filter mode change
2022-06-13 09:33:05 +01:00
Sam Edwards
e0ba60fc3c
Enhancements to bash init script (#445) 2022-06-07 21:28:06 +00:00
Frank Hamand
3f5350dee6
[feature] Add scroll wheel support to interactive history search (#435) 2022-06-04 10:16:12 +01:00
b3nj5m1n
9ac0c60cc4
Implement cursor (#412) 2022-05-24 20:44:12 +00:00
Satyarth Sampath
119ab9e007
Adds password prompt for register and login (#424)
* Adds the rpassword dependency

* Provides only a prompt based input for login and register with a hidden prompt for password

* Adds option based inputs for login and register commands

* Password can also be provided as an option

Co-authored-by: Satyarth <satyarth.sampath@gojek.com>
2022-05-24 14:25:48 +01:00
noyez
e5df809dd2
Noyez zsh histdb import (#393)
* Attempting to implement zsh-histdb import

Import compiles passes tests, but doesn't run b/c of async runtime.
zsh-histdb uses sqlite, and sqlx-rs is async, but import code is sync.

* More working on importing histdb

* Rewriting tests and using `Vec<u8>` instead of `String`

 - Rewriting tests to eliminate depencency on local file system
 - Using `Vec<u8>` for command strings instead of `String` to eliminate
   the utf8 errors i was seeing previously. Seems to be working.

* Running fmt

Co-authored-by: Bradley Noyes <b@noyes.dev>
2022-05-20 07:36:53 +01:00
Sam Lanning
b08e254343
Improve default fish keybindings (#420)
binding on "up" can conflict with the default fish keybindings as when
in tab-completion mode, you are supposed to be able to use arrow keys
to navigate the grid of suggestions, however pressing "up" will open
the tui instead.

This attempts to work around it by tracking when the user is probably in
a tab completion mode by setting a variable that we use to determine
whether to open atuin or perform the default fish up action
2022-05-20 07:25:36 +01:00
Jakub Jirutka
ab294cde34
Don't pollute shell environment - remove 'id' variable (#408) 2022-05-16 22:13:17 +01:00
Jakub Jirutka
14b30606a5
Allow to build atuin server without client (#404) 2022-05-13 06:57:27 +01:00
Conrad Ludgate
1d030b9d32
Importer V3 (#395)
* start of importer refactor

* fish

* resh

* zsh
2022-05-09 07:46:52 +01:00
Luke Baker
e9d2ec4bf7
Add ctrl-k and ctrl-j for up and down (#394) 2022-05-08 09:03:00 +01:00
Satyarth Sampath
4a839dab44
Adds stats summary (#384)
* stat command parsing is handled without subcommands

* Updates match clause based on PR review

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

* updates value returned by match based on PR review

* adds vscode to gitignore

* use an if statement instead of match

Co-authored-by: Satyarth <satyarth.sampath@gojek.com>
Co-authored-by: Conrad Ludgate <oon@conradludgate.com>
2022-05-03 15:49:27 +01:00
Jakob-Niklas See
9d2e9ea174
Search: Allow specifiying the limited of returned entries (#364)
This patch adds a new option to the search command, allowing to limit
the returned results from the database.
2022-04-28 18:54:16 +01:00
Jakub Panek
93ab4e7842
ignore JetBrains IDEs, tidy-up imports (#348)
* ignore JB IDEs

* tidy-up imports

* add rustfmt config
2022-04-28 18:53:59 +01:00
jean-santos
5926ea64bf
fix import auto for bash (#352) 2022-04-26 17:56:06 +01:00
Conrad Ludgate
7f5310a1aa
history list (#340) 2022-04-25 07:13:30 +01:00
Conrad Ludgate
7436e4ff65
feature-flags (#328)
* use feature flags

* fmt

* fix features

* update ci

* fmt

Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2022-04-22 20:14:23 +00:00
Ellie Huxtable
508d4f4761
History filter (#329)
* Add history filters, and hotkey toggle

Switch between different search modes to narrow down the history you
want - global search for all history, host for all history from your
current machine, session for the current shell session, and directory
for the current directory

The default can be configured via `filter_mode`

* Update docs

* Add context
2022-04-22 21:05:02 +01:00
Conrad Ludgate
02c70deecb
refactor (#327) 2022-04-22 19:24:38 +01:00
Conrad Ludgate
9085485a4f
tracing (#315)
* enable tracing on server

* fmt

* instrument handlers
2022-04-21 18:07:33 +01:00
Conrad Ludgate
d57f549855
refactor commands for better separation (#313)
* refactor commands for better separation

* fmt
2022-04-21 09:12:56 +00:00
Conrad Ludgate
48747e3b7c
A few minor tweaks (#314)
* use bail macro

replace client database errors

remove dead code

* fix test
2022-04-21 08:05:57 +01:00
Conrad Ludgate
3c5fbc5734
provide better error messages (#300) 2022-04-13 18:08:49 +01:00
Conrad Ludgate
a95018cc90
goodbye warp, hello axum (#296) 2022-04-12 23:06:19 +01:00
Jamie Quigley
f861893293
Update to clap 3.1.x (#289) 2022-04-07 06:32:11 +01:00
Jakob Schrettenbrunner
e8f7aaccef
Add compact mode (#288) 2022-04-04 20:59:01 -07:00
Ellie Huxtable
d270798277
Update config-rs (#280)
* Update config-rs

Also fix our call to current_dir

This should resolve #195

Thanks @conradludgate for the upstream fix!

* Format
2022-03-17 21:26:57 +00:00
Lucas Burns
7f587418da
Fix history list --cwd errors (#278) 2022-03-13 19:53:49 +00:00
Patrick Jackson
e117b622fe
Update fish bindings. (#265) 2022-02-15 23:21:28 +00:00
Sandro
4223ac6943
Restore bash 4.2 compatibility, only add hook once (#271) 2022-02-15 22:54:25 +00:00
Sandro
7651f89261
Add support for blesh (#267)
* Fix intendation

* Add support for blesh

See https://github.com/akinomyoga/ble.sh/wiki/Manual-%C2%A71-Introduction#user-content-fn-blehook for more details
2022-01-25 18:33:25 +00:00
Ellie
7fa3e1c0f4
Do not crash if the history timestamp is in the future (#250)
Resolve #189

We were throwing an OutOfRangeError. This occurs when you attempt to
convert to a duration, and your input is <0. A value in the future would
have done this. This is especially noticeable during DST...
2021-12-20 05:52:07 +00:00
Mat Jones
133971179e
Add Alt+backspace and Ctrl+u keybinds for deleting by word and by line, respectively (#243)
* remove unused environment var loading entire history into an env var

* Add Alt+backspace and Ctrl+u keybinds for deleting by word and by line, respectively
2021-12-17 12:14:45 +00:00
Mat Jones
059e858a00
remove unused environment var loading entire history into an env var (#242) 2021-12-16 19:45:05 +00:00
Orhun Parmaksız
079d8037ab
Enable help messages for command line arguments (#239) 2021-12-11 22:29:47 +00:00
Conrad Ludgate
87df7d80ec
Fish importing (#234)
* make a start on fish

* fix

* test

* enable fish

* fmt

* update histpath

set up fish init script

* update readme

* cover edge case

* fmt

* fix session variables

Co-authored-by: PJ <me@panekj.dev>

* respect NOBIND

Co-authored-by: PJ <me@panekj.dev>

* fix env var setting

Co-authored-by: PJ <me@panekj.dev>

* fix whitespace

Co-authored-by: PJ <me@panekj.dev>

* add fish to supported shells

Co-authored-by: PJ <me@panekj.dev>
2021-12-11 09:48:53 +00:00
Orhun Parmaksız
0abd063e01
Support generating shell completions (#235)
* Add gen-completions subcommand for generating shell completions

* Update documentation about generating shell completions

* Include the shell completions in release tarball
2021-12-10 23:59:39 +00:00
Conrad Ludgate
4bdf4c40c2
feat: login/register no longer blocking (#216) 2021-12-08 13:37:49 +00:00
Conrad Ludgate
f539f60ae4
chore: add more eyre contexts (#200)
* chore: add more eyre contexts

* chore: rustfmt
2021-11-17 11:50:34 +00:00
Conrad Ludgate
8f91b1410c
chore: some new linting (#201)
* chore: some new linting

* chore: some more linting

* chore: rustfmt
2021-11-13 22:40:24 +00:00
Jannik
27d3d81afe
feat: allow input of credentials from stdin (#185)
* feat: allow credential input from stdin for registration

This changes the options for register to be optional. If arguments are
not given, the program will ask for them interactively.

* feat: allow credential input from stdin for login

* style: apply cargo fmt
2021-09-24 16:24:59 +00:00