kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.42k stars 151 forks source link

Consider migration to crossterm #133

Open kamiyaa opened 2 years ago

kamiyaa commented 2 years ago

With the release of tui-rs 0.17.0, crossterm is now the default backend for tui-rs.

We might consider migrating to crossterm if there are clear advantages.

Research and feedback would be appreciated.

I will do some research whenever I have time.

adrianstaniec commented 1 year ago

I think the clear advantage would be that it would make josuto also available on Windows!

Ragnyll commented 1 year ago

@kamiyaa is there any chance that you are actively looking at this? I'm starting to look into changing backend.rs to crossterm so I can spend some time with this if it'd help at all.

Using file explorer on window is horrible. So if I can help this along somehow that would great.

Funnily looking to this his how i got down in the rabbit hole of #289

kamiyaa commented 1 year ago

@Ragnyll not currently looking into this at the moment. If we do migrate, I would probably want to keep the termion backend around but just behind a feature flag. Because from my experience, different backends tend to behave a little differently even if they have the same features

Ragnyll commented 1 year ago

i've started a branch over on my fork to screw around with this. At this point I'm just trying to wrap my head around how tui + crossterm + termion work. Hopeuflly i can get a better idea on that this weekend so i can make a little progress. If you have a good idea on what needs to change and wanna enumerate that out here that might be helpful, Otherwise I'm just braindumping whatever i can find as im following the code around on my WIP pr https://github.com/Ragnyll/joshuto/pull/2 .

Ragnyll commented 1 year ago

For whomever is watching this, I've got the AppBackend re-implemented such that the initial UI is rendered. However i still need to rework the event handling system so that it actually does someting. I'm making progress, but this is probably the hard part. We'll see what I can knock out this week.

Ragnyll commented 1 year ago

Hey, so just so yall know, i am still working on this. From @kamiyaa 's request to keep the current termion backend intact and have this be enable via a feature makes this significantly more difficult. Everything on the event side is wired into termion. I tried swapping it out without regard for keeping termion working and i'm still left with a ton of crashes from todo!() .

I'm going to restart from what i had working before, which was really just the tree render, then refactor everything with traits. I think that will make this eventual migration easier. I think that's the move in case we ever need to do something like this again anyways. The tight coupling here makes backend changes rough. that's probably not a surprise to anyone here.

I'm sorry if I'm not moving as fast as people would like to see this feature. My time is pretty limited, but I'm trying to make progress when i can.

DLFW commented 1 year ago

We all know the "limited time" problem ;)

It takes what takes. Your efforts are for sure appreciated! If you can really manage to abstract the backend behind traits, that would be amazing. Hope that goal is reachable with feasible efforts and without to much added code complexity. Wish you luck! 👍

Ragnyll commented 1 year ago

I started a conversation with some of the ratatui guys about some difficulties i'm encountering here. mostly just looking for opinions from them. I'm kinda fumbling around with the terminal read key stuff, if yall have any idea on how i can do that lemme know. i'm not actually getting the input into the buffer i think when using crossterm. Here's the link to the block im having trouble getting to work correctly on crossterm on my branch.

also here is the ratatui discussion if you wanna see it, or just hop in the conversation on that discord 2023-06-06-000744_2590x965_scrot

adrianstaniec commented 5 days ago

because of this issue I switched to https://github.com/sxyazi/yazi (just saying, not hating or sth)

kamiyaa commented 4 days ago

I can look into this again. Thanks for all the work @Ragnyll :pray: