this pr adds the possibility of starting television from a different
directory and it gives the option of complete a partial match. For
example
```fish
cd ~/.config/<ctrl-t> # opens television at '~/.config/' with an empty search bar
cd ~/.config/fi<ctrl-t> # opens television at '~/.config/' with 'fi' in the search bar
```
solves (for zsh shell)
https://github.com/alexpasmantier/television/issues/438
BREAKING CHANGE: the format of the cable channel files and more
specifically the preview specification is updated to be a single table
named `preview` (with keys `command`, `delimiter`, and `offset`) instead
of three flat fields.
```toml
preview_command = "echo 3"
preview_delimiter = " "
preview_offset = "{1}"
```
becomes:
```toml
preview.command = "echo 3"
preview.delimiter = " "
preview.offset = "{1}"
```
Broke away the previewer logic into its own tokio task communicating
with the main thread over two mpsc channels.
Most of the previewer code is now much simpler and less verbose.
This brings quite a nice bump to performance and overall UI
responsiveness and also makes the previewer consume less cpu resources.
This drops the `TelevisionChannel` enum which served as a unified
interface for builtin and cable channels as well as all related macros
and the `television-derive` package.
This simplifies the code quite a lot and will improve overall
maintainability.
BREAKING CHANGE: No more builtin previews which means channels currently using `:files:` and other builtins will now need to rely on external tools (examples to come).
this pr adds the possibility of starting television from a different
directory and it gives the option of complete a partial match. For
example
```fish
cd ~/.config/<ctrl-t> # opens television at '~/.config/' with an empty search bar
cd ~/.config/fi<ctrl-t> # opens television at '~/.config/' with 'fi' in the search bar
```
solves (for fish shell)
https://github.com/alexpasmantier/television/issues/438
This refactors `television/channels/cable.rs` into two additional
submodules:
- `television/channels/cable/preview.rs`
- `television/channels/cable/prototypes.rs`
- tv's default channel (when lauching `tv`) is now configurable via the
`default_channel` configuration option
- add `RUST_BACKTRACE=1` and `--nocapture` to ci testing for better
debugging
- remove all builtin channels and associated glue code as well as the
`ToCliChannel` and `ToUnitChannel` derive macros
- recode all builtin channels using shell commands (along with `fd`,
`bat`, and `rg`)
- add support for interactive shell commands inside cable channels
- drop the `send_to_channel` feature until further notice (will be
reimplemented later on in a more generic and customizable way)
fixes#368
@alexpasmantier I tried to parse down the exact flag to the find method,
but I can't find an elegant way to do so because the channel creates its
own configurations for the matcher inside of the `new` method. I started
adding the exact flag to the new function of each of the channels but it
just does not seem right to do so. Do you have an idea on how to improve
the change? I would think of passing the config struct to the new
function and exposing the config of the channel for channel transitions,
but I'm not sure... 🤔
I have done it here for the stdin channel just to show you how it would
look like and it works fine😄! Looking forward to hearing your thoughts
on that 👍
ref issue: #368
---------
Co-authored-by: Alexandre Pasmantier <alex.pasmant@gmail.com>
#362
Add a custom header and the cli flag for the input field.
Maybe I should replace channel name with header name in the draw method
instead of checking in the draw loop whether the header is there or
not...
Co-authored-by: Alexandre Pasmantier <47638216+alexpasmantier@users.noreply.github.com>
This is hard-coded to be bound to <kbd>C-u</kbd> by default.
With tv's default keybindings configuration, this is overriden by
`scroll_preview_half_page_up` which means users will need to bind that
to something else in order to "unlock" that delete-line functionality.
```
Available recipes:
br # Build the project in release mode
build profile='dev' # Build the project with the specified profile (dev by default) [alias: b]
check # Check the project for errors and warnings [alias: c]
clean # Clean up cargo build artifacts
default # List all available commands
fix # Fix linting and formatting errors [alias: f]
format # Format the code using cargo fmt
lint # Lint the code using cargo clippy
release kind='patch' # Publish a new release (major, minor, or patch) [alias: rl]
run # Run the program in debug mode with logs enabled [alias: r]
setup # Setup the project environment for local development
test # Run the tests for the project [alias: t]
update-changelog # Update the project's changelog
update-man # Update the project's manpages [alias: m]
```
We were drawing an excessive amount of frames while any channel was in
its `running` state which resulted in rendering operations monopolizing
CPU resources thus making the application appear less responsive to the
user.
Fixes#459
I think it's better to insert our output at the cursor so this can be
invoked in the middle of a prompt. Previously we would assume the cursor
is at the end of the prompt and invocation in the middle of one would
discard everything after the cursor.
---------
Co-authored-by: Alexandre Pasmantier <47638216+alexpasmantier@users.noreply.github.com>