{"action":"created","issue":{"url":"https://api.github.com/repos/vim/vim/issues/2865","repository_url":"https://api.github.com/repos/vim/vim","labels_url":"https://api.github.com/repos/vim/vim/issues/2865/labels{/name}","comments_url":"https://api.github.com/repos/vim/vim/issues/2865/comments","events_url":"https://api.github.com/repos/vim/vim/issues/2865/events","html_url":"https://github.com/vim/vim/issues/2865","id":319948825,"number":2865,"title":"Wrap lines in vim in an active terminal session","user":{"login":"Cimbali","id":6126377,"avatar_url":"https://avatars2.githubusercontent.com/u/6126377?v=4","gravatar_id":"","url":"https://api.github.com/users/Cimbali","html_url":"https://github.com/Cimbali","followers_url":"https://api.github.com/users/Cimbali/followers","following_url":"https://api.github.com/users/Cimbali/following{/other_user}","gists_url":"https://api.github.com/users/Cimbali/gists{/gist_id}","starred_url":"https://api.github.com/users/Cimbali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cimbali/subscriptions","organizations_url":"https://api.github.com/users/Cimbali/orgs","repos_url":"https://api.github.com/users/Cimbali/repos","events_url":"https://api.github.com/users/Cimbali/events{/privacy}","received_events_url":"https://api.github.com/users/Cimbali/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-03T14:37:47Z","updated_at":"2018-05-04T15:46:44Z","closed_at":null,"author_association":"NONE","body":"I've been enjoying the Termdebug feature, but one thing has been nagging me, which that lines are wrapped by inserting newlines in the terminal's output, instead of letting vim handle the wrapping. This has several drawbacks:\r\n\r\n- When resizing windows, this is ugly.\r\n- In particular, when switching from terminal to normal mode, showing line numbers causes every line to be 3-4 characters overlength, which wastes 50% of vertical space.\r\n- long strings (e.g. filepaths) can't be copied in normal mode and used directly, as they now contain arbitrary newlines.\r\n\r\nBoth bash and gdb support not wrapping their output, through a [`set width 0`](https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_183.html) option in gdb, and `setterm --linewrap off` (from the [util-linux package](https://www.kernel.org/pub/linux/utils/util-linux/), so this is probably wider than just bash).\r\n\r\nWith these options enabled, switching a terminal's output to normal mode causes non-terminal-wrapped lines appear as expected, wrapped by vim to whatever the current window width is. However, `:set wrap` does not seem to do anything in terminal mode.\r\n\r\nWould it be possible to wrap lines in an active terminal output?\r\n\r\nThat way, we could enable wrapping whenever we detect that wrapping can be disabled in what the `:terminal` is running (potentially as a vimrc option). This would make the `:terminal` option much more useful IMHO."},"comment":{"url":"https://api.github.com/repos/vim/vim/issues/comments/386642760","html_url":"https://github.com/vim/vim/issues/2865#issuecomment-386642760","issue_url":"https://api.github.com/repos/vim/vim/issues/2865","id":386642760,"user":{"login":"brammool","id":8530623,"avatar_url":"https://avatars2.githubusercontent.com/u/8530623?v=4","gravatar_id":"","url":"https://api.github.com/users/brammool","html_url":"https://github.com/brammool","followers_url":"https://api.github.com/users/brammool/followers","following_url":"https://api.github.com/users/brammool/following{/other_user}","gists_url":"https://api.github.com/users/brammool/gists{/gist_id}","starred_url":"https://api.github.com/users/brammool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brammool/subscriptions","organizations_url":"https://api.github.com/users/brammool/orgs","repos_url":"https://api.github.com/users/brammool/repos","events_url":"https://api.github.com/users/brammool/events{/privacy}","received_events_url":"https://api.github.com/users/brammool/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T15:46:44Z","updated_at":"2018-05-04T15:46:44Z","author_association":"CONTRIBUTOR","body":"\n> Yes, the same happens with a normal terminal. I just thought vim could handle the line wrapping instead of the terminal?\n> \n> The reason this is *especially* annoying in vim, is that switching from terminal to normal mode resizes the window, thus causing every full line to wrap with only a couple of characters after the line break.\n> \n> Other work-arounds could be to force the terminal to wrap lines a little earlier to account for switching to normal mode, or to allow line numbers in terminal mode so the window won't resize.\n\nThis would require Vim to detect that the job is only sending lines of\ntext without being aware of the terminal width.  We do have the\nscrollback, thus in a sense we do some of this.\n\nPerhaps we can detect that the job does not output a line break, but an\nautomatic wrap happens after the rightmost column.  We do something like\nthat for clipboard support.\n\n\n-- \nARTHUR:  I did say sorry about the `old woman,' but from the behind you\n         looked--\nDENNIS:  What I object to is you automatically treat me like an inferior!\nARTHUR:  Well, I AM king...\n                                  The Quest for the Holy Grail (Monty Python)\n\n /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\\\\\n///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\\\\\n\\\\\\  an exciting new programming language -- http://www.Zimbu.org        ///\n \\\\\\            help me help AIDS victims -- http://ICCF-Holland.org    ///\n"}}
{"actor":{"display_login":"brammool"}}