diff --git a/src/extension/extension.ts b/src/extension/extension.ts index 6e1ba997a..a6062b72f 100644 --- a/src/extension/extension.ts +++ b/src/extension/extension.ts @@ -356,28 +356,26 @@ export class RunmeExtension { context.subscriptions.push(new CloudAuthProvider(context)) } - kernel - .runProgram('echo $0') - .then(({ output }) => { - const supportedShells = ['zsh', 'bash'] - const isSupported = supportedShells.some((sh) => output?.includes(sh)) - - if (!isSupported) { - const showMore = 'Show more' - return window.showWarningMessage('Unsupported shell', showMore).then((answer) => { - if (answer === showMore) { - const dashboardUri = getFaqUrl('supported-shells') - const uri = Uri.parse(dashboardUri) - return env.openExternal(uri) - } - }) - } - }) - .catch((_e) => { - getLogger().warn('An error occurred while verifying the supported shell') - }) - await bootFile(context) + + try { + const { output } = await kernel.runProgram('echo $SHELL') + const supportedShells = ['bash', 'zsh'] + const isSupported = supportedShells.some((sh) => output?.includes(sh)) + + if (!isSupported) { + const showMore = 'Show more' + return window.showErrorMessage('Unsupported shell', showMore).then((answer) => { + if (answer === showMore) { + const dashboardUri = getFaqUrl('supported-shells') + const uri = Uri.parse(dashboardUri) + return env.openExternal(uri) + } + }) + } + } catch (_e) { + getLogger().error('An error occurred while verifying the supported shell') + } } protected handleMasking(kernel: Kernel, maskingIsOn: boolean): (e: NotebookUiEvent) => void { diff --git a/src/extension/kernel.ts b/src/extension/kernel.ts index 41cc1aae6..09164e703 100644 --- a/src/extension/kernel.ts +++ b/src/extension/kernel.ts @@ -1114,13 +1114,14 @@ export class Kernel implements Disposable { programOptions = program } else if (typeof program === 'string') { programOptions = { - programName: '', + programName: 'bash', background: false, exec: { type: 'script', script: program, }, languageId: 'sh', + commandMode: CommandModeEnum().INLINE_SHELL, storeLastOutput: false, tty: true, } @@ -1141,7 +1142,7 @@ export class Kernel implements Disposable { programSession.onDidWrite(onData) programSession.onDidErr(onData) - await programSession.run() + programSession.run() return new Promise<{ exitReason?: RunnerExitReason; code?: number | void; output?: string }>( (resolve, reject) => {