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

Incomprehensible output on screen size change for program that draws #155

Open
allgreed opened this issue Jan 5, 2025 · 2 comments
Open

Comments

@allgreed
Copy link

allgreed commented Jan 5, 2025

I use entr to work with taskwarrior so that on one terminal I can see a task report and interact with it on another terminal, like so:
ls ~/.task/pending.data | entr -c task ...

before

The problem is that when I alter the layout on my workspace anyhow (I add a terminal for example) the terminal gets crudely resized and the output doesn't reflow.

after

I was trying to solve this on the end user side, however, I see no easy way of doing this. I'd love to handle SIGWINCH on my own and just trigger entr rerun, however I cannot catch the signal from the parent script (my script which calls entr). Therefore, I think entr itself would be a good place to handle such signal (to trigger utility rerun), preferably gated by a command line option.

Would you welcome such a PR?

@eradman
Copy link
Owner

eradman commented Jan 6, 2025

Yes, I agree that entr is in a good place to handle this signal. The questions are, should this feature be

  1. activated using a command line option or an environment variable
  2. specific to SIGWINCH, or any several signal numbers

Feel free to make a suggestion, I'll reply again with my inclination after thinking on this.

@eradman
Copy link
Owner

eradman commented Jan 7, 2025

I think we should add support for a new environment variable ENTR_TRIGGER_SIGNAL, which allows one of the following to be specified by number:

19  CONT Continued
28  WINCH Window size changes
30  USR1 User defined signal 1
31  USR2 User defined signal 2

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