48 Commits

Author SHA1 Message Date
Alexandre Pasmantier
58d73dbeba
refactor!(previews): drop builtin previewers and all related code and dependencies (#495)
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).
2025-05-06 00:07:50 +02:00
Swann Castel
1086899ba7
feat(ui): add a UI portrait mode #489 (#496)
#489, This PR adds support for television orientation,
input_bar_position is preserved and activating/deactivating the preview
works for both :

1. Landscape (default orientation)

a. input_bar_position = "top"


![image](https://github.com/user-attachments/assets/08f334c0-0780-46ee-aa80-0ccdd1a473eb)

![image](https://github.com/user-attachments/assets/9df6faf5-2211-4fa0-8f08-28688c48e8ee)

b. input_bar_position = "bottom"


![image](https://github.com/user-attachments/assets/223c9814-d1c6-4ed1-b407-b5ba67ebaa06)

![image](https://github.com/user-attachments/assets/9be95c92-f10b-4dec-b423-c7de1f8534d1)

2. Portrait (new orientation)

a. input_bar_position = "top"


![image](https://github.com/user-attachments/assets/71d07092-a175-4978-9ee6-c8978eb83cde)

![image](https://github.com/user-attachments/assets/64d891f4-7acc-456b-a01d-14cab54bff15)

b. input_bar_position = "bottom"


![image](https://github.com/user-attachments/assets/b2c527eb-2c47-404e-8f6d-685b54be71af)

![image](https://github.com/user-attachments/assets/39c9bcaa-cbd5-4d4b-81d8-1e7cfb5bfa10)
2025-05-05 22:37:15 +02:00
Alexandre Pasmantier
67677fb917
refactor!: all channels are now cable channels (#479)
- 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)
2025-04-27 23:50:14 +02:00
Alexandre Pasmantier
d09f6708bc
feat(shell): add fallback channel to the config for smart autocomplete (#413)
Fixes #321
2025-03-20 02:42:58 +01:00
Alexandre Pasmantier
7a85728da6
refactor(config)!: simplify keybindings configuration syntax (#404)
BREAKING CHANGE: mode keybindings dropped in favor of a global table

**What this means in practice:**
```toml
[keybindings.Channel]
quit = ["esc", "ctrl-c"]
# ...

[keybindings.RemoteControl]
quit = ["esc", "ctrl-c"]
# ...

[keybindings.SendToChannel]
quit = ["esc", "ctrl-c"]
# ...
```
are being replaced with
```toml
[keybindings]
quit = ["esc", "ctrl-c"]
# ...
```

Mode keybindings were I believe a premature optimization which only
brought additional complexity and redundancy to the code and did not
provide any real functionality in the current state of things for end
users.
2025-03-19 01:35:29 +01:00
Alexandre Pasmantier
8881842358
refactor(shell): more default shell integration triggers (#335) 2025-02-03 00:12:12 +01:00
Alexandre Pasmantier
a6a73c5bb3
refactor(shell): improve shell integration configuration syntax (#334)
Before:
```toml
[shell_integration.commands]
# Add your commands here. Each key is a command that will trigger tv with the
# corresponding channel as value.
# Example: say you want the following prompts to trigger the following channels
# when pressing <CTRL-T>:
#          `git checkout` should trigger the `git-branches` channel
#          `ls`           should trigger the `dirs` channel
#          `cat`          should trigger the `files` channel
#
# You would add the following to your configuration file:
# ```
# [shell_integration.commands]
# "git checkout" = "git-branch"
# "ls" = "dirs"
# "cat" = "files"
# ```

# environment variables
"export" = "env"
"unset" = "env"

# dirs channel
"cd" = "dirs"
"ls" = "dirs"
"rmdir" = "dirs"

# files channel
"cat" = "files"
"less" = "files"
"head" = "files"
"tail" = "files"
"vim" = "files"
"bat" = "files"

# git-diff channel
"git add" = "git-diff"

# git-branch channel
"git checkout" = "git-branch"
"git branch -d" = "git-branch"

# docker-images channel
"docker run" = "docker-images"

# gitrepos channel
"nvim" = "git-repos"

```

After

```toml
[shell_integration.channel_triggers]
# Add your channel triggers here. Each key is a channel that will be triggered
# by the corresponding commands.
# Example: say you want the following commands to trigger the following channels
# when pressing <CTRL-T>:
#          `git checkout`  should trigger the `git-branches` channel
#          `ls`            should trigger the `dirs` channel
#          `cat` and `cp`  should trigger the `files` channel
#
# You would add the following to your configuration file:
# ```
# [shell_integration.channel_triggers]
# "git-branches" = ["git checkout"]
# "dirs" = ["ls"]
# "files" = ["cat", "cp"]
# ```
"env" = ["export", "unset"]
"dirs" = ["cd", "ls", "rmdir"]
"files" = ["cat", "less", "head", "tail", "vim", "bat"]
"git-diff" = ["git add"]
"git-branch" = ["git checkout", "git branch -d"]
"docker-images" = ["docker run"]
"git-repos" = ["nvim"]
```
2025-02-03 00:03:09 +01:00
Alexandre Pasmantier
be80496549
refactor(draw): clearing out mut operations from rendering critical path, avoiding mutexes and perf improvements (#322) 2025-01-31 22:49:13 +01:00
Bertrand Chardon
5271b507a0
chore(terminal): custom shell keybindings (#313) 2025-01-25 22:43:22 +01:00
Alex Pasmantier
172ba231ee
perf(async): make overall UI much smoother and snappier (#311) 2025-01-25 21:17:31 +01:00
Alex Pasmantier
1934d3f03f
refactor: exit application on SIGINT / C-c (#274)
Fixes #272
2025-01-14 00:03:52 +01:00
Alex Pasmantier
2e5f65baef
feat(channels): add support for multi selection (#234)
Fixes #229 

<img width="1793" alt="Screenshot 2025-01-07 at 00 12 18"
src="https://github.com/user-attachments/assets/f2158c70-b3ab-4c14-8856-eb8463efef8a"
/>
2025-01-07 00:13:05 +01:00
Alex Pasmantier
76bff30759
feat(cable): add default git diff cable channel (#226) 2025-01-06 14:13:04 +01:00
Alex Pasmantier
d7e6c35735
feat(ui): add support for standard ANSI colors theming and update default theme (#221)
Fixes #211 

<img width="2554" alt="Screenshot 2025-01-06 at 13 01 57"
src="https://github.com/user-attachments/assets/3706b93a-4be1-4a88-8c3e-bfb71a36db50"
/>
2025-01-06 13:03:50 +01:00
Alex Pasmantier
2acfc41ceb
feat(ui): respect BAT_THEME env var for previewer syntax highlighting theme (#201)
Fixes #169
2024-12-31 18:53:20 +01:00
Alex Pasmantier
0382ff81b6
docs(config): fix typo in default configuration file comment (#198) 2024-12-31 13:19:09 +01:00
Alex Pasmantier
7614fbc653
feat(shell): add bash support for smart autocomplete and shell history (#184)
Fixes #180
2024-12-30 17:12:16 +01:00
Alex Pasmantier
697f295afb
refactor: update default configuration and simplify channel enum conversions (#157) 2024-12-28 20:09:33 +01:00
Alex Pasmantier
557686e197
feat(config): allow specifying multiple keymaps for the same action + better defaults (#149)
Fixes #135
2024-12-28 15:56:12 +01:00
Alex Pasmantier
499bfdb8e5
refactor(ui): more compact general layout and make preview panel optional (#148)
Fixes #147 

<img width="2552" alt="Screenshot 2024-12-28 at 15 18 42"
src="https://github.com/user-attachments/assets/08e440c2-6878-4a0f-8734-83a8e8b84e5a"
/>
2024-12-28 15:21:17 +01:00
Alex Pasmantier
68d118986c
feat(shell): autocompletion plugin for zsh (#145) 2024-12-25 18:53:50 +01:00
Alex Pasmantier
22f1b4dc33
feat(ui): decouple preview title position from input bar position and make it configurable (#144)
fixes #143 

## example
```toml
[ui]
input_bar_position = "top"
preview_title_position = "top"
```

<img width="2553" alt="Screenshot 2024-12-18 at 22 06 29"
src="https://github.com/user-attachments/assets/6c9ac842-e383-42a8-bdf4-d48c7a826df3"
/>
2024-12-18 22:30:10 +01:00
Alexandre Pasmantier
4164e9092b
feat(themes): more builtin UI themes (#125) 2024-12-15 13:26:28 +01:00
Alexandre Pasmantier
a7064c18c8
refactor(config)!: use $HOME/.config/television by default for macOS (#124) 2024-12-15 12:23:31 +01:00
Alexandre Pasmantier
7b114b7cb6
fix(config): better handling of default values (#123) 2024-12-15 01:09:53 +01:00
Alexandre Pasmantier
37b2dda729
refactor(help): enable help bar by default and add help keybinding (#122) 2024-12-15 00:54:14 +01:00
Alexandre Pasmantier
913aa85af0
feat(themes): add support for ui themes (#114)
fixes #80 

### examples
| gruvbox | solarized |
| :-: | :-: |
| <img width="1792" alt="gruvbox"
src="https://github.com/user-attachments/assets/c0c168a5-5c95-4113-93fd-24b34a9344d8"
/> | ![Screenshot 2024-12-13 at 14 38
57](https://github.com/user-attachments/assets/368e3e37-7fdd-493a-8c0b-47e3731ae67b)
|
2024-12-13 14:54:38 +01:00
Alexandre Pasmantier
6a1359055d
refactor(helpbar): hide the top help panel by default (#97) 2024-12-05 20:41:40 +01:00
Alexandre Pasmantier
220671106e
feat(layout): allow reversing the layout and placing input bar on top (#76) 2024-11-25 21:32:41 +01:00
Alexandre Pasmantier
6d3965152e
feat(navigation): add action to scroll results list by a page (#72) 2024-11-24 16:54:35 +01:00
Alexandre Pasmantier
ccd7c68702
chore(config): default configuration now uses 100% of terminal screen space (#47) 2024-11-20 01:11:43 +01:00
Alexandre Pasmantier
40d5b20c7d
feat(ui): make the top UI help bar toggleable (#41) 2024-11-19 00:07:53 +01:00
Alexandre Pasmantier
75d0bf7b6b
refactor(config)!: make action names snake case in keybinding configuration (#40) 2024-11-18 23:58:02 +01:00
Alexandre Pasmantier
512afa2fda
feat(ui): make help bar display optional (#35) 2024-11-16 20:32:40 +01:00
Alexandre Pasmantier
06a4feb9f2
fix(config): swap out default keymaps with user defined ones instead of stacking (#26)
* fix(config): swap out default keymaps with user defined ones instead of stacking

* fix default configuration fallback
2024-11-15 15:16:00 +01:00
Alexandre Pasmantier
32c114aa9f fix: gag stdout and stderr while loading theme assets to silence bat warning 2024-11-10 14:49:09 +01:00
Alexandre Pasmantier
96976d93cb docs: update README.md 2024-11-10 02:30:08 +01:00
Alexandre Pasmantier
759815ae24 feat: more syntaxes and themes for highlighting + configuration 2024-11-09 19:44:56 +01:00
Alexandre Pasmantier
4302b6189a some work on the configuration file 2024-11-06 00:25:12 +01:00
alexpasmantier
7045295e12 new channel transitions 2024-10-31 13:49:46 +01:00
alexpasmantier
d0d453fe97 feat: send to channel 2024-10-29 21:53:01 +01:00
alexpasmantier
76d32a01c2 great progress 2024-10-27 00:37:13 +02:00
alexpasmantier
9eea37a5b5 top menus 2024-10-25 23:29:07 +02:00
alexpasmantier
4bec64e245 making progress 2024-10-25 00:21:36 +02:00
Alexandre Pasmantier
5556515240 new things 2024-10-21 00:14:13 +02:00
Alexandre Pasmantier
db3aa1ad49 progress 2024-10-20 01:02:53 +02:00
Alexandre Pasmantier
e5f1ebcf71 a first implementation 2024-10-13 20:55:30 +02:00
Alexandre Pasmantier
b514e7ce43 setup 2024-09-15 21:57:36 +02:00