Bug 299437 - Pasting text by middle mouse click into konsole running tmux works not as expected
Summary: Pasting text by middle mouse click into konsole running tmux works not as exp...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-05 11:50 UTC by nicolas.hueppelshaeuser
Modified: 2012-05-06 14:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicolas.hueppelshaeuser 2012-05-05 11:50:43 UTC
I am running tmux in konsole and experience a problem when pasting text by middle mouse button into tmux.

More detailed:
When running tmux, mouse actions can be captured to change the tiling of the screen and more.  Tmux captures action of the mouse buttons, but one can "escape" this by holding shift key pressed.  So shift+mouse button results in the usual behaviour of the mouse clicks.

But not for pasting text by pressing shift+middle mouse button.
Although it works correctly in gnome-terminal and xterm, it does not in konsole.
In konsole it also activates the copy mode of tmux.

So I think this problem relates to konsole rather than tmux.

Details on versions:
Ubuntu 12.04
$ konsole --version
Qt: 4.8.1
KDE: 4.8.2 (4.8.2)
Konsole: 2.8.2
tmux of version 1.6


Reproducible: Always

Steps to Reproduce:
1. remove your ~/tmux.conf for the moment
2. start tmux (you might want to do this simultanously in konsole and e.g. gnome-terminal)
3. press middle mouse button: upper right corner shows [0/0] - tmux copy mode started
4. press left mouse button: copy mode cancelled
Steps 3&4 work correctly
5. select some text with the mouse
6. press shift+middle mouse button to paste text into tmux: on gnome-terminal the selected text is pasted into tmux, on konsole we are back to copy mode. Only after pressing left mouse button, copy mode is cancelled and the pasted text appears.
Actual Results:  
See Steps to Reproduce

Expected Results:  
See Steps to Reproduce
Comment 1 Jekyll Wu 2012-05-05 15:46:37 UTC
Thanks for reporting.

However, I'm quite confused by this report because I'm not a daily user of tmux.

"3. press middle mouse button: upper right corner shows [0/0] - tmux copy mode started"

Well, that is not how tmux works for me. Middle click just pastes. According to tmux(1), the default way of starting copy mode is Ctr-B-[

"4. press left mouse button: copy mode cancelled"

left click makes no change for me

" 6. press shift+middle mouse button to paste text into tmux: on gnome-terminal the selected text is pasted into tmux, on konsole we are back to copy mode. Only after pressing left mouse button, copy mode is cancelled and the pasted text appears.  "

Neither konsole nor gnome-terminal work as describled for me. gnome-terminal does to paste the text after shift+middle click. xterm does not, either.

I'm using a empty ~/.tmux.conf . Did I miss something important?
Comment 2 nicolas.hueppelshaeuser 2012-05-05 16:06:00 UTC
Not you, I missed something important: the line to enable mode-mouse feature.

Here we go again.
Steps to Reproduce:
1. remove your ~/tmux.conf for the moment
2. start tmux (you might want to do this simultanously in konsole and e.g. gnome-terminal)
3. Set mode-mouse on by: "CTRL-B :" now enter at the prompt: "setw -g mode-mouse on"
4. press middle mouse button: upper right corner shows [0/0] - tmux copy mode started
5. press left mouse button: copy mode cancelled
Steps 3&4 work correctly
6. select some text with the mouse
7. press shift+middle mouse button to paste text into tmux: on gnome-terminal the selected text is pasted into tmux, on konsole we are back to copy mode. Only after pressing left mouse button, copy mode is cancelled and the pasted text appears.
Comment 3 Jekyll Wu 2012-05-05 17:41:33 UTC
Git commit 2def15a2db026bc65be956dbc0fbb6c8d765dc7b by Jekyll Wu.
Committed on 05/05/2012 at 19:28.
Pushed by jekyllwu into branch 'master'.

Do not forward the button release event when Shift is also pressed.
FIXED-IN: 4.8.4

M  +3    -2    src/TerminalDisplay.cpp

http://commits.kde.org/konsole/2def15a2db026bc65be956dbc0fbb6c8d765dc7b
Comment 4 Jekyll Wu 2012-05-05 17:43:47 UTC
Git commit efae7d95366a240b953425a1ee6dea15de45332c by Jekyll Wu.
Committed on 05/05/2012 at 19:39.
Pushed by jekyllwu into branch 'KDE/4.8'.

Do not forward the button release event when Shift is also pressed.
FIXED-IN: 4.8.4

M  +4    -4    src/TerminalDisplay.cpp

http://commits.kde.org/konsole/efae7d95366a240b953425a1ee6dea15de45332c
Comment 5 nicolas.hueppelshaeuser 2012-05-06 14:40:17 UTC
Thank you!
Looking forward for the update containing your fix.