nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
377 stars 19 forks source link

Fix missing newline in printing url #38

Closed renkun-ken closed 3 years ago

renkun-ken commented 3 years ago

In VSCode, port mapping in webview under remote development has been broken for quite a while due to upstream issue https://github.com/microsoft/vscode/issues/102449.

The latest VSCode supports auto port-mapping if a URL with port specified is captured in terminal output.

image

Both httpgd and shiny show the url to browse before calling browseURL() but unfortunately some other packages do not do the same, so is the native ? to show the html help.

To walk-around this problem, I need to always print out the browsing URL before sending browser request to vscode-R session watcher as implemented in https://github.com/Ikuyadeu/vscode-R/pull/427 so that VSCode could capture the port in url to perform the port-mapping for the WebView to show properly.

The current message is missing a \n so the two messages are mixed up together:

image

This PR is a simple fix of the http server running at: message so that it will look better:

image