Skip to content

Commit 5695aaa

Browse files
committed
fix: codeflare terminal does not handle command lines with options
This PR also updates hello.md to use `codeflare terminal $SHELL -l`, i.e. adding the `-l` part to ensure that we are launching a login shell. That change needed the fix to handle command lines with options...
1 parent ee6d6a5 commit 5695aaa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

plugins/plugin-client-default/notebooks/hello.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ and machine learning pipelines on the cloud.
6868
outputOnly: true
6969
maximize: true
7070
---
71-
codeflare terminal $SHELL
71+
codeflare terminal $SHELL -l
7272
```

plugins/plugin-codeflare/src/controller/terminal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ export default function openTerminal(args: Arguments) {
4848
// component, which expects something stream-like
4949
const passthrough = new PassThrough()
5050

51-
const { argv, env } = respawn(args.command.replace(/^\s*codeflare\s+terminal\s+/, ""))
51+
// respawn, meaning launch it with codeflare
52+
const { argv, env } = respawn(args.argv.slice(2))
53+
const cmdline = argv.map((_) => encodeComponent(_)).join(" ")
5254

53-
await args.REPL.qexec(argv.map((_) => encodeComponent(_)).join(" "), undefined, undefined, {
55+
await args.REPL.qexec(cmdline, undefined, undefined, {
5456
tab: args.tab,
5557
env,
5658
quiet: true,

0 commit comments

Comments
 (0)