Skip to content
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

[Question] Reflow patch vs St's default reflow patches #135

Open
alipio opened this issue Apr 22, 2024 · 2 comments
Open

[Question] Reflow patch vs St's default reflow patches #135

alipio opened this issue Apr 22, 2024 · 2 comments

Comments

@alipio
Copy link

alipio commented Apr 22, 2024

Hi,

Sorry to bother you, I just want to ask a couple of questions regarding the reflow patch:

  1. What is the difference between this specific patch and all the other patches available on the st site (st-scrollback-reflow-0.9.diff, st-scrollback-reflow-20230607-211964d.diff)? Do they behave the same way?
  2. Do I need the scrollback patch as well? I guess both features were "merged" into the same patch 🤔
  3. Theoretically, I could easily reuse the reflow.c/reflow.h files to patch an "unpatched" version of st too (without using st-flexipatch). Am I right?

I'm asking these question because I'm planning to use st and tried some of these patches in a vanilla version but basically all of them dot not apply cleanly, even though st is basically "unpatched" yet. I know you guys have been doing this for so long, so I'm just seeking for a little help here to guide me in some way. Of course, I'll resolve those conflicts if I have to, or just adopt st-flexipatch as a last resort.

Thanks in advance! Keep up the good work!

@bakkeby
Copy link
Owner

bakkeby commented Apr 23, 2024

Hi @alipio,

  1. What is the difference between this specific patch and all the other patches available on the st site (st-scrollback-reflow-0.9.diff, st-scrollback-reflow-20230607-211964d.diff)? Do they behave the same way?

The patches should in principle behave in the same way, i.e. reflow data when resizing in a similar manner to how it is done when using tmux (st is kind of designed to be used with tmux mind you).

The implementation in st-flexipatch is based on veltza's st-sx build which might be a good place to start rather than patching vanilla st from scratch.

I tried the original patch on a branch columns_reflow two years ago which worked fine but had some issues when resizing the terminal to a single column and back.

  1. Do I need the scrollback patch as well? I guess both features were "merged" into the same patch 🤔

No scrollback is baked into the reflow patch.

In practice reflow would not make much sense without scrollback.

  1. Theoretically, I could easily reuse the reflow.c/reflow.h files to patch an "unpatched" version of st too (without using st-flexipatch). Am I right?

The functions in reflow.c replace functions with the same name in st.c so there would be a lot that you would have to delete manually. There are also quite a few other changes in st.c that would have to be made, so no I don't think that you could just use reflow.c to patch this on a vanilla st.

You do not need to use st-flexipatch, but it may be worth checking as a reference as there may be some integration hints in there that may be of help. The reflow patch specifically do not clash with too many other patches (mostly sixel, openurlonclick and externalpipe).

@alipio
Copy link
Author

alipio commented Apr 23, 2024

Hi,

The implementation in st-flexipatch is based on veltza's st-sx build which might be a good place to start rather than patching vanilla st from scratch.

Good to know. I took a look at the veltza's build and it has basically everything I need! 😁

No scrollback is baked into the reflow patch.

In practice reflow would not make much sense without scrollback.

Yeah, I agree 👍🏻

The functions in reflow.c replace functions with the same name in st.c so there would be a lot that you would have to delete manually. There are also quite a few other changes in st.c that would have to be made, so no I don't think that you could just use reflow.c to patch this on a vanilla st.

Well, I also did my "homework" (while waiting for an answer) and, to be honest, it worked! I made it! I used the reflow.c/reflow.h pair and removed everything in st.c by hand, plus minor tweaks here and there, constantly checking st-flexipatch as a reference like you suggested (I followed my intuition of couse, because I've just read your answer right now).

You do not need to use st-flexipatch, but it may be worth checking as a reference as there may be some integration hints in there that may be of help. The reflow patch specifically do not clash with too many other patches (mostly sixel, openurlonclick and externalpipe).

👍🏻

Anyways, veltza's build is indeed a good place to start. I learned a lot doing my "experiments", but now it's time to move on!

Thank you so much for answering my questions, I really appreciate it! Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants