From c739d2fe870ac911674f9f6955daf21e9068545b Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 10 Oct 2018 14:05:23 +0200 Subject: [PATCH 1/2] Remove underscore from non word characters list This is the upstream fix for Microsoft/vscode#59379 --- src/addons/search/SearchHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addons/search/SearchHelper.ts b/src/addons/search/SearchHelper.ts index d07c6b2c..f23a8c58 100644 --- a/src/addons/search/SearchHelper.ts +++ b/src/addons/search/SearchHelper.ts @@ -4,7 +4,7 @@ */ import { ISearchHelper, ISearchAddonTerminal, ISearchOptions, ISearchResult } from './Interfaces'; -const nonWordCharacters = ' ~!@#$%^&*()_+`-=[]{}|\;:"\',./<>?'; +const nonWordCharacters = ' ~!@#$%^&*()+`-=[]{}|\;:"\',./<>?'; /** * A class that knows how to search the terminal and how to display the results. From eb123ca787a21cd634d08e6e05ff0bd7eedc39e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Thu, 11 Oct 2018 00:32:14 +0200 Subject: [PATCH 2/2] add tiny buffer to server part in demo --- demo/server.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/demo/server.js b/demo/server.js index 0aa9deef..ebe2f644 100644 --- a/demo/server.js +++ b/demo/server.js @@ -58,9 +58,25 @@ app.ws('/terminals/:pid', function (ws, req) { console.log('Connected to terminal ' + term.pid); ws.send(logs[term.pid]); + function buffer(socket, timeout) { + let s = ''; + let sender = null; + return (data) => { + s += data; + if (!sender) { + sender = setTimeout(() => { + socket.send(s); + s = ''; + sender = null; + }, timeout); + } + }; + } + const send = buffer(ws, 5); + term.on('data', function(data) { try { - ws.send(data); + send(data); } catch (ex) { // The WebSocket is not open, ignore }