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

launching neovim causes size of qterminal to increase and sets a minimumsize #288

Closed
surlykke opened this issue Nov 23, 2016 · 7 comments
Closed
Labels

Comments

@surlykke
Copy link
Contributor

I'm experiencing a weird problem - anybody else seing it?
Steps to reproduce:

  • Open qterminal
  • launch nvim
    (the size of qterminal increased by 1 line)
  • exit nvm
  • try to decrease the size of the qterminal window with the mouse. It's not possible.
  • every subsequent invocation of nvim increases the vertical size of qterminal by one line

The problem does not occur with vim. Nor does it occur in other terminal applications (tried xterm and terminology).

I'm not using lxqt, just openbox.

I've done a git bisect and found the behavior to be introduced by:

d24725f: Removed minimum size (#265)

Reverting that commit fixes for me. I have no glimmer of an idea why this commit should cause this behavior.

I suppose the intent of d24725f was to allow really small qterminal's, so as an alternative to reverting, one might apply this:

diff --git a/src/forms/qterminal.ui b/src/forms/qterminal.ui
index c921f50..9814fcd 100644
--- a/src/forms/qterminal.ui
+++ b/src/forms/qterminal.ui
@@ -32,6 +32,12 @@
     </property>
     <item row="0" column="0">
      <widget class="TabWidget" name="consoleTabulator">
+      <property name="minimumSize">
+       <size>
+        <width>1</width>
+        <height>1</height>
+       </size>
+      </property>
       <property name="tabPosition">
        <enum>QTabWidget::South</enum>
       </property>

which also fixes.

@surlykke
Copy link
Contributor Author

Sorry - forgot to mention: I'm using latest qterminal & qtermwidget from git.

@yan12125
Copy link
Member

Reproducible

@yan12125 yan12125 added the bug label Nov 24, 2016
@hamburger1984
Copy link
Contributor

Same here.

@agaida
Copy link
Member

agaida commented Dec 2, 2016

reproducible on debian/sid, latest q* from git - but

the bug seems to be in the widget - steps to reproduce:

  • open qterminal
  • open nvim and leave - can't change the size of qterminal
  • open a new tab
  • close the tab nvim was running in
  • resize qterminal

@yan12125
Copy link
Member

The cause is that neovim sents a resize command to the terminal: https://github.com/neovim/neovim/blob/master/src/nvim/tui/tui.c#L422. The behavior can be simulated by:

echo -e '\e[8;30;20t'

After this command sizeHint() of the TerminalDisplay is changed. On the other hand, the TerminalDisplay has the size policy MinimumExpanding: https://github.com/lxde/qtermwidget/blob/master/lib/qtermwidget.cpp#L271, so the qterminal can't be shrunk to smaller than 30x20.

@surlykke I saw you wrote this line in lxqt/qtermwidget#7. I removed that line and seems the search bar is still working fine. Is there a reason for that line?

@surlykke
Copy link
Contributor Author

Hmm. I'm afraid I have no recollection on why I put that there.
Are you saying that the bug I complained about was introduced by myself >4 years ago?
Wow, that's kinda embarrassing :-(

@yan12125
Copy link
Member

Not really. This bug is a combination of special behavior in neovim and the reaction of qterminal. I feel removing that line the best fix. Hope that won't bring other issues - lxqt/qtermwidget#123

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

No branches or pull requests

4 participants