{"action":"created","issue":{"url":"https://api.github.com/repos/weechat/weechat/issues/777","repository_url":"https://api.github.com/repos/weechat/weechat","labels_url":"https://api.github.com/repos/weechat/weechat/issues/777/labels{/name}","comments_url":"https://api.github.com/repos/weechat/weechat/issues/777/comments","events_url":"https://api.github.com/repos/weechat/weechat/issues/777/events","html_url":"https://github.com/weechat/weechat/issues/777","id":170326377,"number":777,"title":"mouse support breaks copy/paste in screen","user":{"login":"anarcat","id":796623,"avatar_url":"https://avatars.githubusercontent.com/u/796623?v=3","gravatar_id":"","url":"https://api.github.com/users/anarcat","html_url":"https://github.com/anarcat","followers_url":"https://api.github.com/users/anarcat/followers","following_url":"https://api.github.com/users/anarcat/following{/other_user}","gists_url":"https://api.github.com/users/anarcat/gists{/gist_id}","starred_url":"https://api.github.com/users/anarcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anarcat/subscriptions","organizations_url":"https://api.github.com/users/anarcat/orgs","repos_url":"https://api.github.com/users/anarcat/repos","events_url":"https://api.github.com/users/anarcat/events{/privacy}","received_events_url":"https://api.github.com/users/anarcat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/weechat/weechat/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-10T04:38:45Z","updated_at":"2016-08-10T05:52:32Z","closed_at":null,"body":"Weechat seriously garbles basic mouse usage in screen. I can't copy-paste in screen windows reliably when weechat is running in a screen. As soon as I exit weechat, the problem goes away.\r\n\r\nTo reproduce, run: `xterm -e screen -c /dev/null weechat`, then type `control-a c` to open a new shell, then select a part of the prompt with the mouse, and paste it with the middle button. I expected the copy paste to work as usual, but instead, the copied data is pasted with a beep and surrounded by `0~` and `1~`.\r\n\r\nHere's a video of the behavior, which should be available for the next week:\r\n\r\nhttps://share.riseup.net/#h7a1kovsQXviDI1u6YVK7A\r\n\r\nNote that it is the actual paste that is the problem, not the \"copy\". When I paste in a *different* terminal (that is running screen or not), things are fine.\r\n\r\nI can reproduce this with:\r\n\r\n    00:19:05 | WeeChat 1.0.1 [compilé le Sep 28 2014 15:54:55]\r\n    00:19:27 WeeChat 1.5 [compilé le May 30 2016 21:51:51]\r\n    00:24:05     | WeeChat 1.6-dev (git: v1.5-138-g3784cc5) [compiled on Aug 10 2016 00:21:04]\r\n\r\nI am running Debian Jessie 8.5, which ships screen 4.2.1-3+deb8u1 and xterm 312-2. I can also reproduce with rxvt-unicode and gnome-terminal.\r\n\r\nWithin screen, the TERM variable is `screen`. Outside, it is whatever is set by the terminal, which varies in my tests: `rxvt-unicode` or `xterm` (and yes, gnome-terminal lies about being `xterm`).\r\n\r\nInside screen, setting TERM to `xterm`, `rxvt-unicode` or `dumb` fixes the problem but then severly garbles the weechat display.\r\n\r\ntmux doesn't have the same problem (but has other issues that make me weary of switching).\r\n\r\nDisabling mouse support (`/mouse disable` or `/set weechat.look.mouse off`) does not fix the problem.\r\n\r\nThis is somewhat problematic for me as I use copy-paste and screen quite a lot..."},"comment":{"url":"https://api.github.com/repos/weechat/weechat/issues/comments/238772303","html_url":"https://github.com/weechat/weechat/issues/777#issuecomment-238772303","issue_url":"https://api.github.com/repos/weechat/weechat/issues/777","id":238772303,"user":{"login":"flashcode","id":1776783,"avatar_url":"https://avatars.githubusercontent.com/u/1776783?v=3","gravatar_id":"","url":"https://api.github.com/users/flashcode","html_url":"https://github.com/flashcode","followers_url":"https://api.github.com/users/flashcode/followers","following_url":"https://api.github.com/users/flashcode/following{/other_user}","gists_url":"https://api.github.com/users/flashcode/gists{/gist_id}","starred_url":"https://api.github.com/users/flashcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flashcode/subscriptions","organizations_url":"https://api.github.com/users/flashcode/orgs","repos_url":"https://api.github.com/users/flashcode/repos","events_url":"https://api.github.com/users/flashcode/events{/privacy}","received_events_url":"https://api.github.com/users/flashcode/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T05:52:32Z","updated_at":"2016-08-10T05:52:32Z","body":"Hi,\r\n\r\nThis is a known problem of bracketed paste mode with screen (problem is in screen, not WeeChat).\r\nSo when running inside screen, I recommend to turn off bracketed paste mode.\r\n\r\nI think this problem should be mentioned in docs/FAQ, or maybe bracketed paste mode could be off by default then, since a lot of people is still using screen."}}
{"actor":{"display_login":"flashcode"}}