c9 / core

Cloud9 Core - Part of the Cloud9 SDK for Plugin Development https://c9.github.io/core/ https://c9.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scrolling broken in terminal

regalstreak opened this issue · comments

I'm using default bash. When I do scroll up, the terminal wont scroll, but the commands scroll as in when pressed the up arrow key. I am just fed up of this. It used to work perfect before. I dont know suddenly what happened and it stopped working.
Also when i type exit and hit enter, it doesnt close the terminal tab but restarts the terminal in the same tab

sounds like you have modofied your bash config to always turn on the application keypad mode

How do i do that @nightwing

@nightwing No i haven't. It is default

Found it. It is the goddamn tmux version. My packages had been updated by root and it annoyed me v much. I had tmux 2.1. You need to download tmux 1.9 from https://github.com/tmux/tmux/releases/download/1.9/tmux-1.9.tar.gz and compile it and install it. Then make a symlink to /home/user/.c9/bin/tmux

@nightwing maybe you could disable recognising tmux 1.9+ as a "good" tmux version. This is because mouse mode was rewritten from 2.0 and it caused many issues. Hope you do this soon.

Thanks for helping though.

tmux1.9+ works fine on c9.io, the issue may be caused by a setting in your tmux.conf

Could be. Thanks.

commented

I just encountered the same problem and switch my tmux from 2.6 to 1.9, then it's ok.
@nightwing so tmux1.9+ may works fine on c9.io. But the problem is the terminal cannot be scrolled.
Most of people dont care. But if you use it a lot, then it will be a pain.

Has anyone gotten the scroll bars to work with tmux 2.6? Is there a config option or something we can use to make it work. Compiling the older version of tmux on MacOS is proving surprisingly difficult.

@taranda Shouldn't be difficult, what errors are you facing?

commented

Can we have the right tmux included in the install process when an incompatible version is detected?

commented

thank you for finding this @regalstreak . that was so annoying to not have scrolling working.

For what it's worth, on my Ubuntu 16.04 c9.io works fine with apt-get installed tmux v 2.1, scrolling and all.
Before I installed tmux from apt-get, c9.io installer failed to build its own tmux version.

For anyone using a Mac as your Cloud 9 host, you will need to downgrade to tmux 2.3 or earlier to get scrolling to work. This blog post explains how to install an older version of tmux on MacOS.

These are the commands I ran to install tmux 2.3.3 on my Mac:

brew uninstall tmux
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9888d2c21350e3db7732b9783f9368a2d6ad9885/Formula/tmux.rb
tmux -V   # verify that you are running version 2.3
brew pin tmux

@regalstreak Thanks for your willingness to help. I finally found a solution (see above).

Hi,

When you configure zsh with ohmyzsh on a Cloud9 instance, you can comment out line echoti smkx in ~/.oh-my-zsh/lib/key-bindings (https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/key-bindings.zsh#L9 1) and re-start zsh and scrolling will start working as expected :)

You can add exec zsh to your ~/.bashrc for zsh to be your default terminal in Cloud9

sebastien

@nightwing This also happens on AWS Cloud9 with Ubuntu using zsh without omz because the default /etc/zsh/zshrc on Ubuntu puts the terminal into application mode.

This feels like cloud9/tmux is deviating from normal xterm behavior. Application mode should only affect the cursor or numeric keypad key behavior; mouse behavior shouldn't be affected by them I think? xterm.js and vscode had similar problems which have been fixed.

An interim workaround (similar to what @allamand has suggested) is to disable entering application mode in zle, by adding the following to ~/.zshrc

zle-line-init() {}  
zle-line-finish() {}

This doesn't seem an unreasonable thing to do given application mode by default is being removed from omz in ohmyzsh/ohmyzsh#5113