{"action":"created","issue":{"url":"https://api.github.com/repos/tmux/tmux/issues/109","repository_url":"https://api.github.com/repos/tmux/tmux","labels_url":"https://api.github.com/repos/tmux/tmux/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/tmux/tmux/issues/109/comments","events_url":"https://api.github.com/repos/tmux/tmux/issues/109/events","html_url":"https://github.com/tmux/tmux/issues/109","id":106500593,"number":109,"title":"Support background color erase (bce) [was: Vim copy & paste trailing space issue]","user":{"login":"mikehaertl","id":675062,"avatar_url":"https://avatars3.githubusercontent.com/u/675062?v=3","gravatar_id":"","url":"https://api.github.com/users/mikehaertl","html_url":"https://github.com/mikehaertl","followers_url":"https://api.github.com/users/mikehaertl/followers","following_url":"https://api.github.com/users/mikehaertl/following{/other_user}","gists_url":"https://api.github.com/users/mikehaertl/gists{/gist_id}","starred_url":"https://api.github.com/users/mikehaertl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikehaertl/subscriptions","organizations_url":"https://api.github.com/users/mikehaertl/orgs","repos_url":"https://api.github.com/users/mikehaertl/repos","events_url":"https://api.github.com/users/mikehaertl/events{/privacy}","received_events_url":"https://api.github.com/users/mikehaertl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2015-09-15T07:43:22Z","updated_at":"2017-05-11T04:55:08Z","closed_at":"2015-09-15T12:20:27Z","body":"When I run Vim from inside a tmux session and copy some text to the clipboard, each line gets padded with spaces to the right.\n\nFor example, say I have a text file like this:\n\n```\n^some$\n^text$\n```\n\n**Note**: I've used `^` and `$` to mark the beginning and end of a line respectively. They are _not_ part of the file content.\n\nI start tmux and open this file in Vim. I press <kbd>Shift</kbd> (to prevent Vim from processing the mouse click) and mark the complete text by holding the left mouse button clicked. Then I copy it to the clipboard with <kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>c</kbd>.\n\nThe result in the clipboard is something like:\n\n```\n^some                                                  $\n^text                                                  $\n```\n\nNote the extra spaces. (The number of spaces depends on the width of the terminal window.)\n\nIf I start Vim without tmux or if I just `cat` the file content and then copy it, there are no extra spaces. So it must have to do with the combination of Vim + tmux. I've seen this on different Linux flavours, i.e. on Ubuntu and Mint. I use the default terminal (Gnome Terminal 3.6.2) there.\n\nSo how can I prevent this?\n\nMy `tmux.conf`\n\n```\nset-option -g prefix C-a\nset-option -g mouse-utf8 off\nset-option -g status-keys vi\nset-window-option -g mode-keys vi\nset-window-option -g mode-mouse on\nset-option -g terminal-overrides 'xterm*:smcup@:rmcup@'\n\nbind-key C-a last-window\nbind-key C-h select-pane -L\nbind-key C-l select-pane -R\n\n# colors:\nset-option -g status-bg black\nset-option -g status-fg white\nset-option -g status-left '#[fg=green]#H'\nset-window-option -g window-status-current-bg red\n```\n\nI've also tried without the above `.tmux.conf`, using tmux' default settings - no difference.\n\nHere's my `/etc/vim/vimrc.local` that I use on Mint (Ubuntu derivative):\nhttps://gist.github.com/mikehaertl/1612035\n"},"comment":{"url":"https://api.github.com/repos/tmux/tmux/issues/comments/300682111","html_url":"https://github.com/tmux/tmux/issues/109#issuecomment-300682111","issue_url":"https://api.github.com/repos/tmux/tmux/issues/109","id":300682111,"user":{"login":"ktaragorn","id":2549496,"avatar_url":"https://avatars1.githubusercontent.com/u/2549496?v=3","gravatar_id":"","url":"https://api.github.com/users/ktaragorn","html_url":"https://github.com/ktaragorn","followers_url":"https://api.github.com/users/ktaragorn/followers","following_url":"https://api.github.com/users/ktaragorn/following{/other_user}","gists_url":"https://api.github.com/users/ktaragorn/gists{/gist_id}","starred_url":"https://api.github.com/users/ktaragorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktaragorn/subscriptions","organizations_url":"https://api.github.com/users/ktaragorn/orgs","repos_url":"https://api.github.com/users/ktaragorn/repos","events_url":"https://api.github.com/users/ktaragorn/events{/privacy}","received_events_url":"https://api.github.com/users/ktaragorn/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T04:55:08Z","updated_at":"2017-05-11T04:55:08Z","body":"I faced this issue for the longest time as well, and setting `default-terminal` as `xterm` helped."}}
{"actor":{"display_login":"ktaragorn"}}