fix: added wait till terminal prompt for bolt shell execution

This commit is contained in:
Anirban Kar 2024-12-17 14:57:16 +05:30
parent 0ee3736297
commit 69c0bf5873
2 changed files with 6 additions and 1 deletions

View File

@ -1 +1 @@
{ "commit": "1e72d52278730f7d22448be9d5cf2daf12559486", "version": "0.0.2" } { "commit": "0ee373629789f01fb9f54f6747735b51a94a5562" }

View File

@ -105,6 +105,7 @@ export class BoltShell {
* this.#shellInputStream?.write('\x03'); * this.#shellInputStream?.write('\x03');
*/ */
this.terminal.input('\x03'); this.terminal.input('\x03');
await this.waitTillOscCode('prompt');
if (state && state.executionPrms) { if (state && state.executionPrms) {
await state.executionPrms; await state.executionPrms;
@ -145,6 +146,10 @@ export class BoltShell {
terminalOutput.pipeTo( terminalOutput.pipeTo(
new WritableStream({ new WritableStream({
write(data) { write(data) {
/*
* const [, osc] = data.match(/\x1b\]654;([^\x07]+)\x07/) || [];
* console.log('terminal onData', { data,osc });
*/
if (!isInteractive) { if (!isInteractive) {
const [, osc] = data.match(/\x1b\]654;([^\x07]+)\x07/) || []; const [, osc] = data.match(/\x1b\]654;([^\x07]+)\x07/) || [];