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

Integrated terminal scrolling not working in oh-my-zsh #7817

Closed
richarddavenport opened this issue Jun 17, 2016 · 33 comments
Closed

Integrated terminal scrolling not working in oh-my-zsh #7817

richarddavenport opened this issue Jun 17, 2016 · 33 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded

Comments

@richarddavenport
Copy link

  • VSCode Version: 1.3.0-insider 93e6522
  • OS Version: OS X 10.11.5

Steps to Reproduce:

  1. Make more content in the integrated terminal than can fit in the panel.
  2. Try scrolling to the top of the content. Doesn't work for me...
@dbaeumer dbaeumer added terminal Integrated terminal issues bug Issue identified by VS Code Team member as probable bug labels Jun 20, 2016
@Tyriar
Copy link
Member

Tyriar commented Jun 21, 2016

Are you scrolling using mouse/trackpad? Can you try ctrl+shift+arrow/page up/page down (or whatever the OS X equivalent is).

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Jun 21, 2016
@normalser
Copy link

  1. shift+fn+up/down arrow allows to scroll on my OSX 10.11.5 (insider build)
  2. Scrolling with trackpad does not scroll
  3. Trying to highlight more text from terminal that is visible does not trigger scroll (although this also does not work in 1.2.1)

@richarddavenport
Copy link
Author

@wallverb is right. Their points are all correct.

@Tyriar Tyriar added this to the June 2016 milestone Jun 23, 2016
@Tyriar Tyriar added macos Issues with VS Code on MAC/OS X and removed info-needed Issue requires more information from poster labels Jun 23, 2016
@masonicboom
Copy link

I have experienced this. However, I am able to scroll with the trackpad if I place the cursor over the left side of the terminal (where my content is). If I move the cursor too far to the right, I cannot scroll.

Maybe the scrollable element is assuming the minimum width necessary to contain the terminal text, rather than occupying the full width of the terminal.

@Tyriar
Copy link
Member

Tyriar commented Jun 24, 2016

@masonicboom that is expected on stable, on the insiders build scrolling should be working as expected.

@Tyriar
Copy link
Member

Tyriar commented Jun 25, 2016

I can't reproduce on Insiders, two finger trackpad scroll seems to work just fine? OS X Yosemite 10.10.5 on a 2014 MacBook Pro.

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Jun 25, 2016
@Tyriar Tyriar modified the milestones: Backlog, June 2016 Jun 25, 2016
@normalser
Copy link

@Tyriar let me know if I can help somehow to troubleshoot this issue, still not working for me Version 1.3.0-insider (1.3.0-insider) de66522 OS X 10.11.15 - 2012 Macbook Pro

@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2016

@wallverb would you be able to pull down https://github.com/sourcelair/xterm.js and check if you can reproduce on the demo?

@normalser
Copy link

@Tyriar pulled down and started demo - scrolling works fine, let me know what to do next :)

@normalser
Copy link

Found the difference, in xterm.js around lines 1132-1136 in this piece of code:

// allow mousewheel scrolling in
      // the shell for example
      on(el, wheelEvent, function(ev) {
        if (self.mouseEvents) return;
        if (self.applicationKeypad) return;
        if (ev.type === 'DOMMouseScroll') {
          self.scrollDisp(ev.detail < 0 ? -1 : 1);
        } else {
          self.scrollDisp(ev.wheelDeltaY > 0 ? -1 : 1);
        }
        return self.cancel(ev);
      });

In vscode self.applicationKeypad is true that's why it's returning while xterm.js demo has this value set to false

@normalser
Copy link

normalser commented Jun 27, 2016

The reason why it's set to true is due to this flow:

internal/child_process.js line 444:
handleMessage(target, message, undefined); where message={type: 'data', content: "�[K�[?1h�="}

which then calls:
terminalInstance.ts line 47
this.xterm.write(message.content);

which then does:
xterm.js line 1722

 // ESC = Application Keypad (DECPAM).
              case '=':
                this.log('Serial port requested application keypad.');
                this.applicationKeypad = true;
                this.state = normal;
                break;

I hope it helps

One update: seems like xterm demo is starting with bash, while vscode starts with my zsh (https://github.com/robbyrussell/oh-my-zsh)

@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2016

Interesting... Can you check what message.content is in this case? Whatever it is, it seems to be telling xterm to enter the application keypad mode.

@normalser
Copy link

normalser commented Jun 28, 2016

Message content is:
�[0m�[27m�[24m�[J�[01;32m➜ �[36msolution�[00m �[K
and
�[?1h�=

which renders it as:
image

It's definitely related to zsh if i set "terminal.integrated.shell.osx": "/bin/bash" then its ok, but if its "terminal.integrated.shell.osx": "/bin/zsh" then it does not scroll due to = character in �[?1h�=

@normalser
Copy link

normalser commented Jun 28, 2016

Submitted bug at xterm.js repo: xtermjs/xterm.js#151

For time being commenting out line zle -N zle-line-init in ~/.oh-my-zsh/lib/key-bindings.zsh fixes the scroll issue

@Tyriar
Copy link
Member

Tyriar commented Jun 28, 2016

Thanks for investigating this @wallverb! 👍

@Tyriar Tyriar added upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Jun 28, 2016
@niwsa
Copy link

niwsa commented Jul 4, 2016

I am facing scrolling issues in ubuntu 14.04,VSCode version 1.2.1.On scrolling up the text in the console goes far left sometimes(on using ctrl+shift+PgUp) and invisible at other times(on using trackpad).

@richarddavenport
Copy link
Author

@wallverb I think this is specific to oh my zsh, or at least a zsh that is printing an = character. In my oh my zsh theme I also have an = character, but without oh my zsh I do not and scrolling is working. Is there anyway to filter out that character and still have it work?

@Tyriar
Copy link
Member

Tyriar commented Jul 11, 2016

@richarddavenport just tried on my macbook and zsh works fine, I'll update the title accordingly. Since this is an upstream issue, let's centralize discussions in xtermjs/xterm.js#151

@Tyriar Tyriar changed the title Integrated Terminal not scrolling in OS X Integrated terminal scrolling not working in oh-my-zsh Jul 11, 2016
@Tyriar Tyriar removed the macos Issues with VS Code on MAC/OS X label Jul 11, 2016
@richarddavenport
Copy link
Author

@Tyriar @wallverb I opened an issue with oh my zsh and found there is a fix for this issue. I'm running with this branch right now, and scrolling is working!

@ext0
Copy link

ext0 commented Jul 28, 2016

The fix I had was setting the "width" CSS styling property of the "monoco-scrollable-element" to 100%. This immediately completely fixed the issue. This DIV was located as a child element of the "workbench.panel.terminal".

@Tyriar
Copy link
Member

Tyriar commented Jul 28, 2016

@ext0 FYI that element was removed either in 1.3.0 or in the upcoming 1.4.0.

@ext0
Copy link

ext0 commented Jul 28, 2016

@Tyriar Ah gotchya, I haven't updated yet. Good to know!

@technbuzz
Copy link

I am also facing same issue on Windows 10 with VS Code V1.4.0. Ctrl+shift+up/down also not working.

@Tyriar
Copy link
Member

Tyriar commented Aug 15, 2016

@technbuzz this is to do with oh-my-zsh, ctrl+up/down should scroll the terminal on Windows in the latest Insiders build.

@drptbl
Copy link

drptbl commented Aug 30, 2016

Same issue on MAC. Please fix, it's really annoying :(.

@richarddavenport
Copy link
Author

@drptbl The issue is open for OS X, as stated in the opening comment. It's also an upstream issue, meaning that there are other projects that need to be fixed before this one can be fixed. Here's a workaround.

@fallenleavesguy
Copy link

It's really annoying!!!

@Tyriar
Copy link
Member

Tyriar commented Sep 26, 2016

This should be fixed in the next insiders build.

@Tyriar Tyriar closed this as completed Sep 26, 2016
@Tyriar Tyriar modified the milestones: September 2016, Backlog Sep 26, 2016
@Tyriar Tyriar added the verified Verification succeeded label Sep 30, 2016
@StefanoChiodino
Copy link

I'm having the same problem with zhs and bash. Most of the time it scrolls, sometimes it doesn't!

VSC 1.15.1

@Tyriar
Copy link
Member

Tyriar commented Aug 21, 2017

@StefanoChiodino please create a new issue with more details

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests