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

aborted zsh completion not fully cleared #931

Closed
octoploid opened this issue May 15, 2017 · 16 comments
Closed

aborted zsh completion not fully cleared #931

octoploid opened this issue May 15, 2017 · 16 comments

Comments

@octoploid
Copy link

octoploid commented May 15, 2017

log.tar.zip
Start tmux -> dmesg -> type man m[tab]

2017-05-15-075812_538x726_scrot

type [backspace] to abort:
2017-05-15-075821_538x726_scrot

@nicm
Copy link
Member

nicm commented May 15, 2017

Are you sure you have 7a4c66b?

Does this show the same problem (compare inside and outside tmux):

clear;dmesg;printf '\033[3;1H\033[J\033[10;1H'

@octoploid
Copy link
Author

I have 7a4c66b and no, your command line doesn't show any problems.

@nicm
Copy link
Member

nicm commented May 15, 2017

Does this also happen in xterm? Make sure TERM is the same outside tmux in both terminals.

@nicm
Copy link
Member

nicm commented May 15, 2017

Never mind, this is the same bug in Konsole. I thought you couldn't scroll more than the scroll region, but it looks like you can't scroll the whole scroll region either. Compare this in xterm:

clear;seq 100;printf '\033[3;20r\033[18S\033[r';sleep 10

And:

clear;seq 100;printf '\033[3;20r\033[17S\033[r';sleep 10

With a scroll region of 3-20 we need to scroll 18 lines to remove the whole thing. 17 is not enough.

So 7a4c66b is wrong, and I am going to revert it.

tmux needs a working indn if it is specified in terminfo. What did the Konsole guys say to your bug report?

You should be able to work around this for now by doing:

set -as terminal-overrides ',*:indn@'

@octoploid
Copy link
Author

Yes, it also happens in xterm.

@octoploid
Copy link
Author

Commit cb5fcb3 doesn't fix this issue for xterm.

@nicm
Copy link
Member

nicm commented May 15, 2017

Show me logs from using xterm with latest master please (only need the server log).

@octoploid
Copy link
Author

Sorry, false alarm (had an unnoticed tmux instance running in the background).
Xterm is fine now.

@nicm
Copy link
Member

nicm commented May 15, 2017

OK cool. I don't think there is a practical way to detect this bug, I think it will need to be fixed in Konsole.

@octoploid
Copy link
Author

I would be good if you could open a Konsole bug yourself, because I don't understand the issue sufficiently:
https://bugs.kde.org/enter_bug.cgi?product=konsole

@octoploid
Copy link
Author

Ah, found the konsole bug: https://bugs.kde.org/show_bug.cgi?id=379318

@nicm
Copy link
Member

nicm commented May 15, 2017

Yes I think this bug report is fine. If you can figure out how to build Konsole you could try this, which copies the check in Screen::scrollDown() to Screen::scrollUp():

diff --git a/src/Screen.cpp b/src/Screen.cpp
index d456d67..02c1e4c 100644
--- a/src/Screen.cpp
+++ b/src/Screen.cpp
@@ -868,7 +868,9 @@ QRect Screen::lastScrolledRegion() const

 void Screen::scrollUp(int from, int n)
 {
-  if (n <= 0 || from + n > bmargin) return;
+  if (n <= 0) return;
+  if (from > bmargin) return;
+  if (from + n > bmargin) n = bmargin - from;

   _scrolledLines -= n;
   _lastScrolledRegion = QRect(0,tmargin,columns-1,(bmargin-tmargin));

@nicm
Copy link
Member

nicm commented May 15, 2017

Actually that was a very old tree, try this:

diff --git a/src/Screen.cpp b/src/Screen.cpp
index 90671829..fd8e5c3c 100644
--- a/src/Screen.cpp
+++ b/src/Screen.cpp
@@ -752,7 +752,12 @@ QRect Screen::lastScrolledRegion() const

 void Screen::scrollUp(int from, int n)
 {
-    if (n <= 0 || from + n > _bottomMargin) return;
+    if (n <= 0)
+        return;
+    if (from > _bottomMargin)
+        return;
+    if (from + n > _bottomMargin)
+        n = _bottomMargin - from;

     _scrolledLines -= n;
     _lastScrolledRegion = QRect(0, _topMargin, _columns - 1, (_bottomMargin - _topMargin));

@octoploid
Copy link
Author

octoploid commented May 16, 2017

Thanks. I have created: https://git.reviewboard.kde.org/r/130133/diff/1#index_header

(there was an off by one error in your patch, which caused exactly the same issue that I've described above)

diff --git a/src/Screen.cpp b/src/Screen.cpp
index 90671829bf9b..45b8da0ab0e9 100644
--- a/src/Screen.cpp
+++ b/src/Screen.cpp
@@ -752,7 +752,12 @@ QRect Screen::lastScrolledRegion() const
 
 void Screen::scrollUp(int from, int n)
 {
-    if (n <= 0 || from + n > _bottomMargin) return;
+    if (n <= 0)
+        return;
+    if (from > _bottomMargin)
+        return;
+    if (from + n > _bottomMargin)
+        n = _bottomMargin + 1 - from;
 
     _scrolledLines -= n;
     _lastScrolledRegion = QRect(0, _topMargin, _columns - 1, (_bottomMargin - _topMargin));

@octoploid
Copy link
Author

Not a tmux bug. Lets close this issue.

@lock
Copy link

lock bot commented Feb 16, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants