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

Resizing the terminal causes lines to disappear #2

Closed
elldritch opened this issue May 25, 2017 · 11 comments
Closed

Resizing the terminal causes lines to disappear #2

elldritch opened this issue May 25, 2017 · 11 comments

Comments

@elldritch
Copy link

I use this theme with terminator, and opening a new terminal window below (using ctrl+O) often causes the previous terminal window to lose lines. I'm not totally sure what's causing this, but this problem doesn't occur with other zsh themes. I suspect it has to do with resizing code that clears too many lines.

@yardnsm
Copy link
Owner

yardnsm commented May 25, 2017

Can you please upload some screenshots regarding this issue? Also, what do you mean by "resizing code that clears too many lines"?

@elldritch
Copy link
Author

Here's an example:

I start by executing a command that outputs some lines.

2017-05-25-005440_771x548_scrot

Then I press ctrl+O to split my terminal. This actually resizes the old terminal, and opens a new one below it.
2017-05-25-005452_766x540_scrot

Notice how some of the lines from the previous command's output are now gone. Now if I close the bottom terminal, which resizes the top one back to its original size, I see another weird effect.
2017-05-25-005658_764x542_scrot

I haven't looked at the internals of the theme at all, but my guess is that there's some code that's running every time the terminal is resized that is entering control sequences that cause this. This weird resizing effect also occurs while running interactive programs (e.g. vim or less) and makes some of those programs unusable after the terminal is resized.

@yardnsm
Copy link
Owner

yardnsm commented Jun 4, 2017

Actually there isn't such a resize code, but I am doing some weird stuff there. I'm planning on a rewrite, so expect some updates soon.

@yardnsm
Copy link
Owner

yardnsm commented Jun 9, 2017

Just updated the theme, this should be working fine now.

However, and I did notice it in other themes that has an upper right segment (such as bart), when resizing the terminal horizontally, things can get ugly:

screen shot 2017-06-09 at 15 33 19

If this bother you, you can set BLOX_SEG__UPPER_RIGHT to a blank array or set BLOX_CONF__ONELINE for a oneline prompt.

@avently
Copy link

avently commented Oct 23, 2017

@yardnsm

things can get ugly

yeah, that's true.
export BLOX_SEG__UPPER_RIGHT=() doesn't work. I mean it looks weird event with this option. BLOX_CONF__ONELINE works but i want to use two lines without resizing glitch. Do you know a way to make this possible?

@yardnsm
Copy link
Owner

yardnsm commented Oct 23, 2017

@avently It works fine for me for the following basic config:

BLOX_CONF__ONELINE=false
BLOX_SEG__UPPER_LEFT=(blox_block__cwd)
BLOX_SEG__UPPER_RIGHT=()

Can you upload a screenshot please?

@yardnsm yardnsm reopened this Oct 23, 2017
@avently
Copy link

avently commented Oct 24, 2017

You can reproduce it. Just choose directory with long name and make your terminal window slower than length of directory name.
screenshot-2017-10-24_035320_567778808

So i think we need to find another way to do things (not what you did in 14c75a8 )

@avently
Copy link

avently commented Oct 24, 2017

yardnsm added a commit that referenced this issue Oct 25, 2017
@yardnsm
Copy link
Owner

yardnsm commented Oct 25, 2017

The link was useful, the solution fixed the redrawing issue with the upper segments, but it still may redraw the lower left segment since I'm still setting PROMPT to show it (otherwise we would have a newline after the lower segments).

@avently
Copy link

avently commented Oct 26, 2017

@yardnsm try to replace
RPROMPT='${lower_right}'
with this:
[[ $lower_right != " " ]] && RPROMPT='${lower_right}'

Because RPROMPT is the cause of that issue now. So, if a user doesn't use lower_right corner we don't need to use RPROMPT.
With our changes we get properly resizing window but not for guys who use lower_right corner and top_right corner is unresponsive to width changes (because ${spacing} is called only once).

yardnsm added a commit that referenced this issue Oct 26, 2017
@yardnsm
Copy link
Owner

yardnsm commented Oct 26, 2017

So RPROMPT is set only if there's something in the lower right segment. About the "unresponsiveness" of the upper segments, I'll probably work on that sometime in the future.

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

3 participants