codacus commited on
Commit
69c0bf5
·
1 Parent(s): 0ee3736

fix: added wait till terminal prompt for bolt shell execution

Browse files
Files changed (2) hide show
  1. app/commit.json +1 -1
  2. app/utils/shell.ts +5 -0
app/commit.json CHANGED
@@ -1 +1 @@
1
- { "commit": "1e72d52278730f7d22448be9d5cf2daf12559486", "version": "0.0.2" }
 
1
+ { "commit": "0ee373629789f01fb9f54f6747735b51a94a5562" }
app/utils/shell.ts CHANGED
@@ -105,6 +105,7 @@ export class BoltShell {
105
  * this.#shellInputStream?.write('\x03');
106
  */
107
  this.terminal.input('\x03');
 
108
 
109
  if (state && state.executionPrms) {
110
  await state.executionPrms;
@@ -145,6 +146,10 @@ export class BoltShell {
145
  terminalOutput.pipeTo(
146
  new WritableStream({
147
  write(data) {
 
 
 
 
148
  if (!isInteractive) {
149
  const [, osc] = data.match(/\x1b\]654;([^\x07]+)\x07/) || [];
150
 
 
105
  * this.#shellInputStream?.write('\x03');
106
  */
107
  this.terminal.input('\x03');
108
+ await this.waitTillOscCode('prompt');
109
 
110
  if (state && state.executionPrms) {
111
  await state.executionPrms;
 
146
  terminalOutput.pipeTo(
147
  new WritableStream({
148
  write(data) {
149
+ /*
150
+ * const [, osc] = data.match(/\x1b\]654;([^\x07]+)\x07/) || [];
151
+ * console.log('terminal onData', { data,osc });
152
+ */
153
  if (!isInteractive) {
154
  const [, osc] = data.match(/\x1b\]654;([^\x07]+)\x07/) || [];
155