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

Commit e4ff10d

Browse files
starpitk8s-ci-robot
authored andcommitted
fix(plugins/plugin-bash-like): in headless mode, don't bother trying to memoize user's alias and env
1 parent 5f38f20 commit e4ff10d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/core/src/core/capabilities.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ export const assertHasProxy = () => {
106106
state.hasProxy = true
107107
}
108108

109+
/**
110+
* Are we the Kui proxy?
111+
*
112+
*/
113+
export const inProxy = () => {
114+
return process.env.KUI_REPL_MODE !== undefined
115+
}
116+
109117
/**
110118
* Yes, we are running in a sandbox
111119
*

packages/core/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export {
2222
inElectron,
2323
isHeadless,
2424
inSandbox,
25+
inProxy,
2526
assertInSandbox,
2627
assertLocalAccess,
2728
assertHasProxy,

plugins/plugin-bash-like/src/preload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import Debug from 'debug'
1818
const debug = Debug('plugins/bash-like/preload')
1919
debug('loading')
2020

21-
import { inBrowser, CapabilityRegistration, PreloadRegistrar } from '@kui-shell/core'
21+
import { inBrowser, isHeadless, inProxy, CapabilityRegistration, PreloadRegistrar } from '@kui-shell/core'
2222

2323
import { preload as registerCatchAll } from './lib/cmds/catchall'
2424

2525
export const registerCapability: CapabilityRegistration = async (registrar: PreloadRegistrar) => {
2626
if (inBrowser()) {
2727
await import('./pty/session').then(({ init }) => init(registrar))
28-
} else {
28+
} else if (!isHeadless() || inProxy()) {
2929
try {
3030
const prefetchShellState = (await import('./pty/prefetch')).default
3131
await prefetchShellState()

0 commit comments

Comments
 (0)