57 Commits

Author SHA1 Message Date
lalvarezt
b8be7a94d8 feat(bindings)!: initial steps for a new and more expressive bindings system 2025-07-23 10:00:20 +02:00
Alex Flores
e809ccf686
feat(config): add support for custom input prompt in user config (#648) 2025-07-18 17:16:51 +02:00
MohMine
4e90a357e8
feat(themes): allow users to add theme overrides using their config file
Fixes #560

### Add theme color overrides in configuration file

Link to #560

### Problem

Currently, customizing television's appearance to match personal style
requires users to rebuild from source code to modify theme colors. This
creates a significant barrier for users who want to personalize their
experience without dealing with compilation and development setup.
Users who want to adjust colors for better readability, match their
terminal theme, or create custom color schemes must either:
- Modify theme files in the source code
- Rebuild the entire application
- Maintain separate theme files
This workflow is not user-friendly and prevents quick experimentation
with different color combinations.

### Solution
Added theme color overrides directly in the configuration file, allowing
users to customize any theme color without rebuilding from source. The
themes/*.toml files now serve as defaults, while the configuration file
provides overrides that take precedence.

### Key features:
- No rebuild required: Customize colors instantly through config
- Easy testing: Try different color combinations without compilation
- Theme flexibility: Mix and match colors from different themes
- Backward compatible: Existing configs continue to work unchanged
- User-friendly: Simple TOML syntax for color customization

### Usage Example

Find your config file location:
```
 Default locations:
   # Unix: ~/.config/television/config.toml
   # Windows: %APPDATA%\television\config.toml
```

Add theme overrides to your config:

```
[ui]
   theme = "catppuccin"  # or any other theme
   
   [ui.theme_overrides]
   background = "#000000"      # Pure black background for maximum contrast
   text_fg = "#00ff00"         # Bright green for main text (high visibility)
   selection_bg = "#ff00ff"    # Bright magenta for selected items (eye-catching)
   selection_fg = "#ffffff"    # Pure white text on selected items (high contrast)
   match_fg = "#ffff00"        # Bright yellow for search matches (stands out)
   border_fg = "#00ffff"       # Bright cyan for borders (neon effect)
   result_name_fg = "#ff8800"  # Bright orange for file names (warm highlight)
   result_value_fg = "#ff0080" # Bright pink for values (vibrant accent)
```


Test your changes:

```
# Run with your config
./target/release/tv --config-file ~/.config/television/config.toml
```

<img width="1420" alt="Screenshot 2025-07-08 at 08 14 42"
src="https://github.com/user-attachments/assets/90563f86-74aa-460a-a7c2-82080be3dc0b"
/>

---------

Co-authored-by: Mohamed-Amine Bousahih <mohamed-aminebousahih@pc-66.home>
Co-authored-by: Mohamed-Amine Bousahih <mohamed-aminebousahih@mohamedminesair.home>
2025-07-11 00:06:46 +02:00
LM
45139457a1
feat: add global/channel input history (#573)
sometimes I want to tweak the previous search, or just run it again.
this solves that problem

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-07-01 12:49:01 +02:00
LM
42e2728269 test(cli): new cli test suite (#564)
new set of test that cover the overall functionality of the cli

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:59:57 +02:00
LM
23f52d4533 feat(ui): Optional scrollbar and mouse support for the preview panel (#563)
cleaned up keybinding section from config

@alexpasmantier you had this code before, perhaps there was a reason for
it?

```rust
        if cfg!(not(windows)) {
            execute!(buffered_stderr, DisableMouseCapture)?;
        }
```
2025-06-28 16:59:52 +02:00
LM
58d90c6d03 refactor(ui): feature based UI (#562)
- Migrate to a feature based UI
- Introduces television/features.rs with a flags-based Features type
(PREVIEW_PANEL, HELP_PANEL, STATUS_BAR, REMOTE_CONTROL).
- Per-feature configuration sections: [ui.preview_panel],
[ui.status_bar], [ui.remote_control], [ui.help_panel]
- Rename Keybinding panel ➜ Help panel
- CLI & housekeeping
  - new CLI toggle --no-status-bar, updated docs and man page
  - import clean up
2025-06-28 16:56:09 +02:00
LM
ad4e254ae6 feat(ui): new keybindings panel and status bar (#559)
Add a new keybinding manager (à la which-key helix style)

it adapts to the current mode

channel mode

![image](https://github.com/user-attachments/assets/d1748d93-d62b-4377-a4cd-9825318300e0)

remote mode

![image](https://github.com/user-attachments/assets/fa6ab776-a9bd-421c-ae75-a0b6013401fa)

Add sorting for remote entries

---------

Co-authored-by: Alex Pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
alexandre pasmantier
51617b1775 refactor: clearer separation of channels vs remote, better deserialization of prototype sub-structures, etc. 2025-06-28 16:56:09 +02:00
alexandre pasmantier
53c36f040c refactor: add reload and cycle source to default keymaps + default keymap changes
toggle remote: Ctrl-r -> Ctrl-t
reload source: Ctrl-r
cycle sources: Ctrl-s
2025-06-28 16:56:09 +02:00
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