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:
parent
64fb590377
commit
f4d2be5053
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user