Прокрутка на Mac с Tmux и iTerm

12665
Jim

Я использую iTerm 2.1.4 и Tmux на OS X Yosemite. Я хотел бы иметь возможность прокручивать свои окна iTerm вверх и вниз, но я не уверен, что контролирует прокрутку. Управляет ли tmux прокрутка, когда я использую его с iTerm, или iTerm все еще контролирует прокрутку?

Я пытался использовать различные клавиши, которые должны прокручивать iTerm, но все, что я получаю, это символы "~~~~~" в командной строке. Как мне прокрутить эту настройку?

7

1 ответ на вопрос

15
notdavidcronenberg

Tmux scrolling is a little different than just scrolling with a mouse wheel or a trackpad.

In tmux, scrolling is accomplished by first sending 'prefix-['. You'll see a little yellow box in the upper, right-hand corner of your terminal window.

In this mode, you can use arrow keys, PageUp, PageDown, Ctrl-U, Ctrl-D, hjkl (vi-mode), or other configurable movement keys to scroll forward or back through the buffer.

There is an option in relatively recent builds of tmux that allows you to use the mouse while in scrolling mode.

add this to your .tmux.conf

set-option -g mouse on 

Additionally, if memory serves, tmux is 'built into' iTerm, and thus features like multiplexing are built in as well. Is there a reason you want to use tmux in iTerm? The built-in OSX Terminal is definitely enhanced by a multiplexer like tmux, but iTerm seeks to alleviate those shortcomings by being a standalone solution.

EDIT 1: After upgrading to El Capitan, I noticed some unfamiliar behavior when using Terminal.app and tmux. This led me to an excellent article detailing options I wasn't aware of and which look to answer your question more thoroughly than I could hope to. All the options are tmux-specific, as far as I can tell, and are independent of OSX versions, so using them in Yosemite should be fine. Your scrolling question is covered here, with options like:

bind-key -t vi-copy WheelUpPane scroll-up bind-key -t vi-copy WheelDownPane scroll-down 

Many more useful options in the article linked below.

https://ryanfb.github.io/etc/2015/10/19/tmux_mouse_mode_on_el_capitan.html

Ссылка в нижней части этого ответа отличная, но сейчас она немного устарела. Для достижения вашей цели вам также необходимо прочитать это: https://github.com/tmux/tmux/issues/754#issuecomment-297452143 John Ruiz 6 лет назад 3
Не работает для меня на высоких сьерра Ulysse BN 5 лет назад 0
работает в iterm2 с использованием tmux, но портит себя в Terminal.app такими вещами, как прокрутка в vim, перестает работать, а затем копирование и вставка становятся более странными Ishan Srivastava 5 лет назад 0