115 Commits

Author SHA1 Message Date
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
Alexandre Pasmantier
7a54e5a507 chore: bump to 0.10.0 2025-01-25 21:21:08 +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
51b1b42c74
chore(deps): remove color_eyre and other unneeded features (#309) 2025-01-25 14:29:02 +01:00
Alex Pasmantier
1e8c8dbc96
refactor: simplify configuration and build code + leaner crate (#308) 2025-01-25 13:26:07 +01:00
Alex Pasmantier
3970f65946
chore: flatten workspace into a single crate (#306) 2025-01-25 00:44:34 +01:00
Alex Pasmantier
40c97c9c4c
chore: bump workspace to 0.9.4 (#293) 2025-01-20 12:16:06 +01:00
Alex Pasmantier
8bbebf7e57
fix(syntect): switch back to oniguruma while investigating parsing issues (#292)
Temp fix for #289
2025-01-20 12:09:00 +01:00
Alex Pasmantier
a43ed22666
chore: bump workspace to 0.9.3 (#287) 2025-01-19 20:47:05 +01:00
Alex Pasmantier
a3dc8196aa
perf(preview): add partial preview rendering and buffer preview requests (#285) 2025-01-19 18:16:34 +01:00
Alexandre Pasmantier
1a4dae9bd8 chore: bump to 0.9.2 2025-01-09 23:25:59 +01:00
Alexandre Pasmantier
d00d8e4f84 chore: bump to 0.9.1 2025-01-09 14:28:06 +01:00
Alex Pasmantier
853da49425
chore: bump to 0.9.0 (#249) 2025-01-07 23:29:14 +01:00
Alex Pasmantier
1c00dece94
fix(ansi): catch implicit reset escape sequences (#245)
Fixes #232 

<img width="2549" alt="Screenshot 2025-01-07 at 16 04 15"
src="https://github.com/user-attachments/assets/18be9901-757e-47a4-aa70-89aa7fc75e84"
/>
2025-01-07 16:06:23 +01:00
Alex Pasmantier
0624002f35
perf: use FxHash instead of SipHash where it makes sense (#237) 2025-01-07 02:11:12 +01:00
Alex Pasmantier
263e88beb6
chore(deps): mutualize workspace dependencies (#236) 2025-01-07 01:09:14 +01:00
Alexandre Pasmantier
6536bbf323 chore: bump to 0.8.8 2025-01-06 13:46:41 +01:00
Alex Pasmantier
25adee34d8
chore: bump to 0.8.7 (#217) 2025-01-05 00:32:41 +01:00
Alexandre Pasmantier
df936dd4eb chore: bump to 0.8.6 2025-01-01 12:08:22 +01:00