-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea for the future: Support only cable channels
and stdin
#253
Comments
@xosxos I agree with most of your points, and am pretty much on board with the overall idea but need to put a bit of thinking into it before I come up with a more detailed response. Thanks for sharing this 🙏🏻 |
The way I see this:
[[cable_channel]]
name = "channel_A"
# ...
[[cable_channel]]
name = "channel_B"
# ...
transitions_into = {
channel_A = {
format_entry = "{0}",
delimiter = "\t"
}
}
If we're heading that way, I feel like the best route to get there would be to work our way towards feature parity between builtin and cable channels before anything else (and work on "commands to run on selection" on the way there).
|
Glad to hear you think this could be a way forward! For now I forked, refactored things and turned this into a mono repo (not saying its desirable). Compilation dependencies went down to ~260. I don´t think I removed any major dependency either so it´s probably an issue with the workspace not resolving dependencies optimally. I will continue to see how lean this can get while maintaining feature parity. I also implemented in application logging but I´ll get back to you when I have solid code. I plan on working on bits and pieces until I have what I want, and then, if some refactors and implementations make sense for television, pieces can be merged in. After I have a full understanding of the code I can do patches for the main as well.
I agree on the previewers. I think the implementation however could be a single struct. Then in the config, the :files: syntax would just initiate the previewer with the appropriate settings.
The config draft makes sense. I don't quite understand the transitions as I haven´t used them. It´s something my brain might not be able to handle while working. I.e. take these files, then search for this string. I would just construct a pipe for this. But I feel there is potential I cannot quite grasp yet. Especially if a single channel with a preview and run commands is considered a single "application", then the transitions could be considered as dynamic piping. If you would add transition commands separately (in relation to run commands), it would be like dynamic piping on steroids I suppose.
Fully agree on all points. And the default channels would probably have to be running GNU applications which kinda sucks in the year 2025, but what can you do. All in all, I guess the features that would make me happy are:
And on the code side:
|
First of all, the idea is great but the rust performance and possibilities are currently way better. I stumbled upon this myself while writing a But I have an idea how we could close this gap. I use
If would be great if Either way, first class support would increase the overall snappiness for bigger inputs and would almost be a requirement to keep the blazingly fast label. Watcha y'all think? |
This is already the case, or did I just misunderstand your point? [[cable_channel]]
name = "long-running"
source_command = 'for i in {1..1000}; do echo "This is line number $i"; sleep .5; done'
preview_command = "echo {}" async_tv.mp4 |
Hey, I went through the code in fork. I managed to conserve most of the functionality and got the dependencies down to 172 (starting from over 400?) by merging into a single crate structure and clearing out some dependencies. I played around refactoring to a more model-view-controller file structure, removed the builtin channels and refactored the keybindings and layout to end up with around 7,3 kLOC, starting from around 11k I think. I implemented an option to include several commands for three categories: transitions, run commands and preview commands. For example, For run commands, the command could either be set to exit the application, or to not exit. For example, in I created a simple file browser using channels which can transition between dirs and files and is able to zip files etc. Next, I'll try to create something like I also added a rudimentary logger view to ease with the debugging. It's not all 100% functional nor beautiful yet, but maybe you could check the fork out to maybe in the future incorporate some of the changes into |
I actually stumbled upon your fork yesterday and took a look at it. Plenty of interesting things and looking forward to integrate some of them. Will take a deeper look in the days to come. Great work! |
Hey,
I am proposing a major change so this is a long one....
I have been absolutely awestruck how good the idea of custom
channels
, with a custompreview
and customrun
options is. I feel TUI applications are often cumbersome to use and not good for customization. So, shell functions combined with pipes and aliases and all the unix stuff is the daily driver for me.However, the way this apllication is designed actually invites all the unix love into a TUI. I can create countless applications for countless use cases (git, docker, ps) in the same general framework of
television
. And I think that's the kicker here. I believetelevision
should take a more frameworky approach.What I am suggesting is to ditch the hard coded channels and concentrate on the cable channels via a config. This would greatly reduce code complexity and code duplication both in the channels and previews section. I think it would also eliminate the need for the procedural macros written to hide this complexity in
TelevisionChannel
. This would be beneficial because generative code is much harder to reason about in relation to normal code.The thought came up when I was creating a shitty implementation of #16 and I realized I have to either support all the hard-coded variants currently present and FUTURE ones as well. Which would mean more code complexity. That's when I tried implementing the hard-coded channels via the config file and I could do a 1-to-1 replication of many of them (but not all, and colors don't work!).
So, I think it would be good to have a single very customizable
Previewer
, which would supportcable_channels
andstdin
with full feature parity. Meaning, all options in theconfig
would be available as parameters for theclap
app. This would solve #190 as well, because instead of implementing it on the application side (by adding more code), it can, and I think should be, implemented OUTSIDE the application:What I am envisioning is for example creating a program manager under the
television
framework:However,
transitions
and how they could be defined via the config.That's my two cents, and it might not align with the future planned for this project, but thanks for writing an inspiring application!
Any general thoughts on this @alexpasmantier ?
The text was updated successfully, but these errors were encountered: