Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 374fa5b

Browse files
committed
fix(plugins/plugin-kubectl): for now, send kubectl ... $(...) command lines to pty
At some point, we could get more sophisticated, and expand the $(...) subprocess executions, and still handle the rest in kui.
1 parent 555d803 commit 374fa5b

File tree

1 file changed

+4
-2
lines changed
  • plugins/plugin-kubectl/src/controller/kubectl

1 file changed

+4
-2
lines changed

plugins/plugin-kubectl/src/controller/kubectl/exec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ export function doExecWithStdout<O extends KubeOptions>(
9595
* required? That is, versus a plain nodejs spawn/exec.
9696
*
9797
*/
98-
export function reallyNeedsPty({ argvNoOptions }: Pick<Arguments, 'argvNoOptions'>) {
99-
return argvNoOptions.includes('|') || argvNoOptions.includes('>') || argvNoOptions.includes('>>')
98+
export function reallyNeedsPty({ argvNoOptions, parsedOptions }: Pick<Arguments, 'argvNoOptions' | 'parsedOptions'>) {
99+
const test1 = (_: string) => /(\$\(|`)/.test(_) // subprocess execution?
100+
const test2 = (_: string) => /^\s*(\||>|>>)\s*$/.test(_) || test1(_)
101+
return !!argvNoOptions.find(test2) || !!Object.values(parsedOptions).find(test1)
100102
}
101103

102104
/**

0 commit comments

Comments
 (0)