1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix shell connection readiness heuristic

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-09-14 09:23:13 -04:00
parent 64fb590377
commit f4d2be5053
2 changed files with 3 additions and 3 deletions

View File

@ -119,9 +119,9 @@ export class TerminalApi extends WebSocketApi {
* its own rc file (or RunCommands file) such as `.bashrc` or `.zshrc`.
*
* This heuistic assumes that the prompt line of a terminal is a single line
* and ends with a whitespace character.
* and ends with a whitespace character or the > character (windows's CMD).
*/
if (data.match(/\r?\n/) === null && data.match(/\s$/)) {
if (data.match(/\r?\n/) === null && data.match(/(\s|>)$/)) {
this.shellRunCommandsFinished = true;
this.onData.removeListener(this._onShellRunCommandsFinished);
}

View File

@ -120,7 +120,7 @@ export class TerminalStore extends Singleton {
const rcIsFinished = when(() => this.connections.get(tab.id).shellRunCommandsFinished);
const notifyVeryLong = setTimeout(() => {
rcIsFinished.cancel();
Notifications.info("Terminal shell is taking a long time to complete startup. Please check your .rc file. Bypassing shell completion check.", {
Notifications.info("Terminal shell is taking a long time to complete startup. Bypassing shell completion check.", {
timeout: 4_000,
});
}, 10_000);