133 Commits

Author SHA1 Message Date
Aiden Scandella
83f29f7418
feat(zsh): add tv cli options/arguments/subcommands autocompletion (#665)
## 📺 PR Description

update `init` shell generation to include autocompleting options for
`tv` itself.

<img width="817" height="497" alt="image"
src="https://github.com/user-attachments/assets/e65bc0aa-410e-43ef-86a5-2d6e01c6c1df"
/>

<img width="837" height="186" alt="image"
src="https://github.com/user-attachments/assets/6d9665f6-0664-4e6e-bce3-e6a970c79524"
/>

I've only tested this on macOS (arm64) with `zsh` and `bash` so far:

<img width="893" height="349" alt="image"
src="https://github.com/user-attachments/assets/dd66ecec-fee3-4713-a68c-f69e961a4ba6"
/>



## Checklist

<!-- a quick pass through the following items to make sure you haven't
forgotten anything -->

- [x] my commits **and PR title** follow the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format
- [x] if this is a new feature, I have added tests to consolidate the
feature and prevent regressions
- [ ] if this is a bug fix, I have added a test that reproduces the bug
(if applicable)
- [ ] I have added a reasonable amount of documentation to the code
where appropriate

---------

Co-authored-by: Alex Pasmantier <47638216+alexpasmantier@users.noreply.github.com>
2025-07-25 22:34:06 +02:00
alexandre pasmantier
c533c41540 chore: release version 0.12.5 2025-07-18 02:35:03 +02:00
alexandre pasmantier
e87f7d30a8 chore: release version 0.12.4 2025-07-13 13:57:54 +02:00
alexandre pasmantier
d5adad0323 chore: release version 0.12.3 2025-07-13 01:16:08 +02:00
Alex Pasmantier
d05b22d82b chore: bump to 0.12.2 2025-07-10 18:40:00 +02:00
Alex Pasmantier
85a538d257 chore: bump to 0.12.1 2025-07-10 00:01:19 +02:00
alexandre pasmantier
f1c68167ea chore: bump to 0.12.0 2025-07-07 18:21:18 +02:00
alexandre pasmantier
141d3e7fb9 chore: update dependencies 2025-06-28 18:09:02 +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
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
alexandre pasmantier
7067a2ba93 feat(remote): rework remote UI and add description and requirements panels 2025-06-28 16:56:09 +02:00
LM
a2ebbb3557 refactor(cli): add validation logic + docs
This PR contains the following changes
- Add validation logic and dependencies
- Remove deprecated frame rate
- Bump string_pipeline to 0.12.0 (solves debug syntax from templates)
- Document cli functionality (markdown and docstrings)

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
alexandre pasmantier
b780fa1ba5 test(e2e): add proper e2e tests and pty-testing utils 2025-06-28 16:56:09 +02:00
LM
510e7b6338 feat(ui): add support for customizing input_header, preview_header and preview_footer
This PR adds support for customizing

* input_header
* preview_header
* preview_footer

all the items are of type MultiTemplate, this gives some flexibility
when showing the selected value, let's say on the preview header, if
it's long or you want only a section

---------

Co-authored-by: alexandre pasmantier <alex.pasmant@gmail.com>
2025-06-28 16:56:09 +02:00
alexandre pasmantier
3b57710006 test(e2e): more end to end tests 2025-06-28 16:56:09 +02:00
alexandre pasmantier
8d822cd2fc test(e2e): add e2e tests for secondary cli commands (version, init, list-channels, ...) 2025-06-28 16:56:09 +02:00
alexandre pasmantier
3e98475e35 fix(github): improve ux when downloading cable channels 2025-06-28 16:56:09 +02:00
alexandre pasmantier
e76a3df776 refactor(cable)!: cable format redesign 2025-06-28 16:56:09 +02:00
Alexandre Pasmantier
2b2654b6aa
refactor: drop TelevisionChannel enum and all associated macros (#498)
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.
2025-05-06 11:18:32 +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
Alexandre Pasmantier
cc27b5ec6b refactor: drop dependency to the ignore crate (#493) 2025-05-01 23:05:56 +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
f28c18ed64 chore: release version 0.11.9 2025-04-22 01:22:23 +02:00
Alex Pasmantier
b4438ab835 chore: bump to 0.11.8 2025-04-20 21:44:41 +02:00
Alex Pasmantier
169358442b chore: bump to 0.11.7 2025-04-12 23:15:18 +02:00
Alexandre Pasmantier
a008d3f4b4
chore: bump to 0.11.6 (#457) 2025-04-09 22:02:32 +00:00
dependabot[bot]
6d26db2993
chore(deps): bump tokio from 1.44.1 to 1.44.2 (#453)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.1 to 1.44.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.44.2</h2>
<p>This release fixes a soundness issue in the broadcast channel. The
channel
accepts values that are <code>Send</code> but <code>!Sync</code>.
Previously, the channel called
<code>clone()</code> on these values without synchronizing. This release
fixes the channel
by synchronizing calls to <code>.clone()</code> (Thanks Austin Bonander
for finding and
reporting the issue).</p>
<h3>Fixed</h3>
<ul>
<li>sync: synchronize <code>clone()</code> call in broadcast channel (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7232">#7232</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/7232">#7232</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7232">tokio-rs/tokio#7232</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ec4b1d7215"><code>ec4b1d7</code></a>
chore: forward port 1.43.x</li>
<li><a
href="e3c3a56718"><code>e3c3a56</code></a>
Merge branch 'tokio-1.43.x' into forward-port-1.43.x</li>
<li><a
href="a7b658c35b"><code>a7b658c</code></a>
chore: prepare Tokio v1.43.1 release</li>
<li><a
href="c1c8d1033d"><code>c1c8d10</code></a>
Merge remote-tracking branch 'origin/tokio-1.38.x' into
forward-port-1.38.x</li>
<li><a
href="aa303bc205"><code>aa303bc</code></a>
chore: prepare Tokio v1.38.2 release</li>
<li><a
href="7b6ccb515f"><code>7b6ccb5</code></a>
chore: backport CI fixes</li>
<li><a
href="4b174ce2c9"><code>4b174ce</code></a>
sync: fix cloning value when receiving from broadcast channel</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.44.1&new-version=1.44.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/alexpasmantier/television/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-08 12:48:11 +00:00
Alexandre Pasmantier
875b63defe chore: bump to 0.11.5 2025-04-01 01:31:51 +02:00
Alexandre Pasmantier
5f8b240c8b chore: bump to 0.11.4 2025-03-23 16:56:53 +01:00
Alexandre Pasmantier
dae6a8816a chore: bump to 0.11.3 2025-03-21 22:00:05 +01:00
Alexandre Pasmantier
918dc6686d chore: bump to 0.11.2 2025-03-21 01:12:45 +01:00
Alexandre Pasmantier
b48127bbba chore: bump to 0.11.1 2025-03-20 20:44:33 +01:00
Alexandre Pasmantier
4e900d92c3
fix(ci): use fancy-regex when compiling on arm64 instead of oniguruma (#422) 2025-03-20 19:54:17 +01:00
Alexandre Pasmantier
409d951d3c chore: bump to 0.11.0 2025-03-20 15:39:07 +01:00
alexpasmantier
961ebbba2b chore: bump to 0.10.10 2025-03-18 02:21:24 +01:00
Alexandre Pasmantier
0edf224502
docs(man): add man pages for tv (#397)
![image](https://github.com/user-attachments/assets/8e8fc26e-2a55-4a2e-8b55-fb92cace1a02)
2025-03-18 01:23:02 +01:00
alexpasmantier
f397dd5a70 chore: bump to 0.10.9 2025-03-17 01:59:00 +01:00
github-actions[bot]
d601eb2c02 chore(changelog): update changelog (auto) (#386)
This PR was created by a GitHub Action to update the changelog.

Co-authored-by: alexpasmantier <47638216+alexpasmantier@users.noreply.github.com>

chore(changelog): update changelog (auto) (#387)

This PR was created by a GitHub Action to update the changelog.

Co-authored-by: alexpasmantier <47638216+alexpasmantier@users.noreply.github.com>

chore: bump to 0.10.8
2025-03-16 17:21:12 +01:00
alexpasmantier
5a4c9d3296 chore: bump to 0.10.7 2025-03-06 13:55:19 +01:00
Emile Schupbach
3441587d57 feat(preview): add support for image previews (#363)
I initially didn't notice that an image previewer was already
implemented but commented out—still, I wanted to finish mine! :)

It works almost instantly on my side. I tested it in different terminals
and only noticed some slowness in the RustRover-integrated terminal.

So far, I’ve tested it with PNG, JPEG, ICO, GIF, and TIFF formats, and
it works well. In theory, it should support all formats that the image
crate can handle. I included them in the file list but commented out the
ones I haven’t tested yet.

To optimize memory usage, images are resized to a maximum of 128x128
before being cached. I’m not really sure what the best size is, since
the image gets resized again when rendered to fit the preview window.

Let me know if you have any feedback! 🚀

![ferris](https://github.com/user-attachments/assets/8683642d-8662-4baf-8157-8093a5fe0467)

![poke](https://github.com/user-attachments/assets/3b48c7e9-c86e-470e-97a8-992637765fa0)

![street](https://github.com/user-attachments/assets/95b94818-727f-499f-b4ed-19e39e6d0252)

---------

Co-authored-by: Alexandre Pasmantier <47638216+alexpasmantier@users.noreply.github.com>
Co-authored-by: alexpasmantier <alex.pasmant@gmail.com>
2025-03-05 18:02:14 +01:00
Alexandre Pasmantier
63cb976027
refactor(ui): communicate ui state to tv using channels (#369)
The state of the UI is now synchronized with the `Television` struct
using a dedicated channel and is available at `Television.ui_state`.
This removes quite a bit of complexity from the existing code and should
allow for nicer implementations of features that need the UI state to
compute things in the background (typically knowing the target size of
an image you wish to construct in the background, as in #363)

The `UiState` currently only holds the UI layout:
```rs
pub struct UiState {
    pub layout: Layout,
}
```
2025-03-05 01:11:24 +01:00
Alexandre Pasmantier
e2a0fb2047
fix(clipboard): fix issue where clipboard wouldn't work on X11-based environments (#364)
fixes #282 

tested with the following setup:
```
                   -`                    alex@alex-mbp
                  .o+`                   -------------
                 `ooo/                   OS: Arch Linux x86_64
                `+oooo:                  Host: MacBookPro10,2 1.0
               `+oooooo:                 Kernel: 6.13.3-arch1-1
               -+oooooo+:                Uptime: 1 hour, 8 mins
             `/:-:++oooo+:               Packages: 559 (pacman)
            `/++++/+++++++:              Shell: zsh 5.9
           `/++++++++++++++:             Resolution: 2048x1280
          `/+++ooooooooooooo/`           WM: awesome
         ./ooosssso++osssssso+`          Theme: Adwaita [GTK3]
        .oossssso-````/ossssss+`         Icons: Adwaita [GTK3]
       -osssssso.      :ssssssso.        Terminal: tmux
      :osssssss/        osssso+++.       CPU: Intel i5-3230M (4) @ 3.200GHz
     /ossssssss/        +ssssooo/-       GPU: Intel 3rd Gen Core processor Graphics Controller
   `/ossssso+/:-        -:/+osssso+-     Memory: 4180MiB / 7815MiB
  `+sso+:-`                 `.-/+oso:
 `++:.                           `-/+/
 .`                                 `/


```
2025-02-24 21:50:53 +01:00
Alexandre Pasmantier
28f62f138d chore: bump to 0.10.6 2025-02-08 15:34:10 +01:00
Alexandre Pasmantier
5d552d1655 chore: bump to 0.10.5 2025-02-07 20:17:50 +01:00
Alexandre Pasmantier
eaafe40cfb chore: bump to 0.10.4 2025-02-03 00:16:15 +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
6955c5b313
chore: bump to 0.10.3 (#329) 2025-02-01 00:09:02 +01:00
Alexandre Pasmantier
5214dd17d0
refactor(app): buffering actions and events handling to improve overall UI responsiveness (#328) 2025-01-31 23:58:13 +01:00
Alexandre Pasmantier
a03da82c56 chore: bump to 0.10.2 2025-01-26 22:04:00 +01:00
Alex Pasmantier
82f471d0aa
fix(cli): re-enable clap help feature (#315)
Fixes #314
2025-01-26 09:49:53 +01:00