* add cwd aware hinter
towards https://github.com/nushell/nushell/issues/8883
* handle the case where get_current_dir returns Err
* WIP cwd aware hinter
- guard CwdAwareHinter with feature flag
- remove references to fish from DefaultHinter as fish is cwd aware
- add example
* document that CwdAwareHinter is only compatible with sqlite history
* handle non-sqlite history
* handle no sqlite feature in example
* fix warnings
`.with_buffer_editor()` now expects a `std::process::Command` that can be provided with additional arguments and a tempfile that is unique.
---------
Co-authored-by: Horasal <horsal@horsal.dev>
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
* Improve history isolation
After this change we will get rows:
- that have the same session_id, or
- have a lower id than the first command with our session_id, or
- if there's no command with our session_id, take the whole history.
* Enforce history_isolation also for hints
* Store the session_timestamp in `SqliteBackedHistory`
* add use_kitty_protocol support option
* move pop key enhancement flags just before loop exit
* add pop keyboard flags pop on drop
* remove toggler functions' return
* move pop key enhancement flags beside other mode change
Replace scrolling via escape sequence with workaround that prints newlines to retain scrollback
regardless of terminal implementation of scroll sequence
- `strum`/`strum_macros` enables upgrade to `syn 2.0`
- `pretty-assertions` gets rid of `ctor` and other outdated dev-deps
- `rstest` also helps with `syn` but introduces `regex` dev-dep
* fix: prompt position on resize
* fix: u16 overflow
* fix: prompt position when terminal grows in height
* fix: exclude blank area from prompt height
fix: resume the early return to exclude a case where the terminal got smaller but the prompt is still visible
* fix: prevent any line overwriting at the cost of duplicate prompts
* fix: prevent width change from eating previous output
Combinations like `Ctrl+Alt+a` could not be mapped previously, since
some non-us keyboard layouts use those combinations for sending
characters like `@`.
Now, first check if there a binding was defined using that combination,
else interpret as raw characters. This should not affect those special
keyboard layouts, since they would be sending `Ctrl+Alt+<special char>`,
rather than what would be on the US layout.
E.g.
- Map `Ctrl+Alt+a` to an action
- `Ctrl+Alt+a` on (some) german keyboards would send `@`
- A german layout pressing those keys would send a key combination of `Ctrl+Alt+@`,
so they are unaffected by this change (they would have to specifically
map `Ctrl+Alt+@`)
- For any layout actually sending `Ctrl+Alt+a`, they get the mapped action
This also allows the user to bind a keybinding without modifiers.
This affects emacs mode and vi insert mode (vi normal mode
already allows such keybindings).
* add `HistoryFilter` and use it in engine, to allow not storing items with a given prefix
* use `with_history_exclusion_prefix` in demo
* review
* impl history filter on engine
* keep 1 filterered history item
* don't impl History on Box<T: History>