{"action":"created","issue":{"url":"https://api.github.com/repos/keithw/mosh/issues/637","labels_url":"https://api.github.com/repos/keithw/mosh/issues/637/labels{/name}","comments_url":"https://api.github.com/repos/keithw/mosh/issues/637/comments","events_url":"https://api.github.com/repos/keithw/mosh/issues/637/events","html_url":"https://github.com/keithw/mosh/issues/637","id":89148636,"number":637,"title":"mosh does not transmit OSC 52 sequence to client","user":{"login":"sunaku","id":9863,"avatar_url":"https://avatars.githubusercontent.com/u/9863?v=3","gravatar_id":"","url":"https://api.github.com/users/sunaku","html_url":"https://github.com/sunaku","followers_url":"https://api.github.com/users/sunaku/followers","following_url":"https://api.github.com/users/sunaku/following{/other_user}","gists_url":"https://api.github.com/users/sunaku/gists{/gist_id}","starred_url":"https://api.github.com/users/sunaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunaku/subscriptions","organizations_url":"https://api.github.com/users/sunaku/orgs","repos_url":"https://api.github.com/users/sunaku/repos","events_url":"https://api.github.com/users/sunaku/events{/privacy}","received_events_url":"https://api.github.com/users/sunaku/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-17T23:03:13Z","updated_at":"2015-06-29T22:09:56Z","closed_at":null,"body":"Similar to #549 and #552, this limitation prevents me from copying text from remote shell sessions into my local terminal via [the OSC 52 escape sequence](https://github.com/macton/hterm#does-hterm-support-the-osc-52-aka-clipboard-operations-sequence).  It's also the reason I still use SSH instead of Mosh. :scream:\r\n\r\nI tried to patch this but got stuck. :cry:  Any hints on how to write a string to the raw terminal device?\r\n\r\n```diff\r\ndiff --git a/src/terminal/terminalfunctions.cc b/src/terminal/terminalfunctions.cc\r\nindex 35c8055..1983aec 100644\r\n--- a/src/terminal/terminalfunctions.cc\r\n+++ b/src/terminal/terminalfunctions.cc\r\n@@ -558,6 +558,46 @@ void Dispatcher::OSC_dispatch( const Parser::OSC_End *act, Framebuffer *fb )\r\n        * 2: set window title */\r\n       cmd_num = OSC_string[ 0 ] - L'0';\r\n       offset = 2;\r\n+    } else if ( (OSC_string.size() >= 3) && (OSC_string[ 2 ] == L';') ) {\r\n+      /* OSC of the form \"\\033]XX;<Pt>\\007\" where XX can be:\r\n+       * 10: Change VT100 text foreground color to Pt.\r\n+       * 11: Change VT100 text background color to Pt.\r\n+       * 12: Change text cursor color to Pt.\r\n+       * 13: Change mouse foreground color to Pt.\r\n+       * 14: Change mouse background color to Pt.\r\n+       * 15: Change Tektronix foreground color to Pt.\r\n+       * 16: Change Tektronix background color to Pt.\r\n+       * 17: Change highlight background color to Pt.\r\n+       * 18: Change Tektronix cursor color to Pt.\r\n+       * 19: Change highlight foreground color to Pt.\r\n+       * 46: Change Log File to Pt.  (This is normally disabled by a compile-time option).\r\n+       * 50: Set Font to Pt.\r\n+       * 51: reserved for Emacs shell.\r\n+       * 52: Manipulate Selection Data.\r\n+       */\r\n+      cmd_num = 10 * (OSC_string[ 0 ] - L'0') +\r\n+                     (OSC_string[ 1 ] - L'0');\r\n+      offset = 3;\r\n+    } else if ( (OSC_string.size() >= 4) && (OSC_string[ 3 ] == L';') ) {\r\n+      /* OSC of the form \"\\033]XXX;<Pt>\\007\" where XXX can be:\r\n+       * 104: Reset Color Number c.\r\n+       * 105: Reset Special Color Number c.\r\n+       * 106: Enable/disable Special Color Number c.\r\n+       * 110: Reset VT100 text foreground color.\r\n+       * 111: Reset VT100 text background color.\r\n+       * 112: Reset text cursor color.\r\n+       * 113: Reset mouse foreground color.\r\n+       * 114: Reset mouse background color.\r\n+       * 115: Reset Tektronix foreground color.\r\n+       * 116: Reset Tektronix background color.\r\n+       * 117: Reset highlight color.\r\n+       * 118: Reset Tektronix cursor color.\r\n+       * 119: Reset highlight foreground color.\r\n+       */\r\n+      cmd_num = 100 * (OSC_string[ 0 ] - L'0') +\r\n+                 10 * (OSC_string[ 1 ] - L'0') +\r\n+                      (OSC_string[ 2 ] - L'0');\r\n+      offset = 4;\r\n     }\r\n     bool set_icon = (cmd_num == 0 || cmd_num == 1);\r\n     bool set_title = (cmd_num == 0 || cmd_num == 2);\r\n@@ -569,6 +609,9 @@ void Dispatcher::OSC_dispatch( const Parser::OSC_End *act, Framebuffer *fb )\r\n \r\n       act->handled = true;\r\n     }\r\n+    else {\r\n+      // HELP ME: how can I write the OSC_string as-is to the terminal device?\r\n+    }\r\n   }\r\n }\r\n \r\n ```"},"comment":{"url":"https://api.github.com/repos/keithw/mosh/issues/comments/116861276","html_url":"https://github.com/keithw/mosh/issues/637#issuecomment-116861276","issue_url":"https://api.github.com/repos/keithw/mosh/issues/637","id":116861276,"user":{"login":"vdrandom","id":3367071,"avatar_url":"https://avatars.githubusercontent.com/u/3367071?v=3","gravatar_id":"","url":"https://api.github.com/users/vdrandom","html_url":"https://github.com/vdrandom","followers_url":"https://api.github.com/users/vdrandom/followers","following_url":"https://api.github.com/users/vdrandom/following{/other_user}","gists_url":"https://api.github.com/users/vdrandom/gists{/gist_id}","starred_url":"https://api.github.com/users/vdrandom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdrandom/subscriptions","organizations_url":"https://api.github.com/users/vdrandom/orgs","repos_url":"https://api.github.com/users/vdrandom/repos","events_url":"https://api.github.com/users/vdrandom/events{/privacy}","received_events_url":"https://api.github.com/users/vdrandom/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T22:09:56Z","updated_at":"2015-06-29T22:09:56Z","body":"(I'm not really sure if it's the right place, but another issue is a couple of years old with no news: #352, and this seems related.)\r\nMaybe support cursor shape change escapes as well:\r\n```\r\n\\033[X \\007\r\nor\r\n\\e[X q\r\n```\r\nwhere X indicates the shape of the text cursor"}}