diff --git a/packages/cli/src/ui/components/Footer.test.tsx b/packages/cli/src/ui/components/Footer.test.tsx
index ab242928aa..97c3b1f29b 100644
--- a/packages/cli/src/ui/components/Footer.test.tsx
+++ b/packages/cli/src/ui/components/Footer.test.tsx
@@ -366,7 +366,7 @@ describe('', () => {
unmount();
});
- it('should display "current process" for macOS Seatbelt when SANDBOX is sandbox-exec', async () => {
+ it('should display "macOS seatbelt (test-profile)" for macOS Seatbelt when SANDBOX is sandbox-exec', async () => {
vi.stubEnv('SANDBOX', 'sandbox-exec');
vi.stubEnv('SEATBELT_PROFILE', 'test-profile');
const { lastFrame, unmount } = await renderWithProviders(, {
@@ -374,7 +374,7 @@ describe('', () => {
width: 120,
uiState: { isTrustedFolder: true, sessionStats: mockSessionStats },
});
- expect(lastFrame()).toContain('current process');
+ expect(lastFrame()).toContain('macOS seatbelt (test-profile)');
vi.unstubAllEnvs();
unmount();
});
diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx
index 378e89e453..f9ad0627c8 100644
--- a/packages/cli/src/ui/components/Footer.tsx
+++ b/packages/cli/src/ui/components/Footer.tsx
@@ -69,25 +69,46 @@ interface SandboxIndicatorProps {
isTrustedFolder: boolean | undefined;
}
+function getSandboxDisplayString(
+ sandbox: string | undefined,
+ sandboxEnabled: boolean,
+ isTrustedFolder: boolean | undefined,
+): string {
+ if (isTrustedFolder === false) {
+ return 'untrusted';
+ }
+
+ if (sandbox) {
+ if (sandbox === 'sandbox-exec') {
+ const profile = process.env['SEATBELT_PROFILE'] || 'permissive-open';
+ return `macOS seatbelt (${profile})`;
+ }
+ return 'current process';
+ }
+
+ if (sandboxEnabled) {
+ return 'all tools';
+ }
+
+ return 'no sandbox';
+}
+
const SandboxIndicator: React.FC = ({
isTrustedFolder,
}) => {
const config = useConfig();
const sandboxEnabled = config.getSandboxEnabled();
- if (isTrustedFolder === false) {
- return untrusted;
- }
-
const sandbox = process.env['SANDBOX'];
- if (sandbox) {
- return current process;
- }
+ const displayString = getSandboxDisplayString(
+ sandbox,
+ sandboxEnabled,
+ isTrustedFolder,
+ );
- if (sandboxEnabled) {
- return all tools;
- }
+ const color =
+ displayString === 'no sandbox' ? theme.status.error : theme.status.warning;
- return no sandbox;
+ return {displayString};
};
const CorgiIndicator: React.FC = () => (
@@ -308,11 +329,11 @@ export const Footer: React.FC = () => {
break;
}
case 'sandbox': {
- let str = 'no sandbox';
- const sandbox = process.env['SANDBOX'];
- if (isTrustedFolder === false) str = 'untrusted';
- else if (sandbox) str = 'current process';
- else if (config.getSandboxEnabled()) str = 'all tools';
+ const str = getSandboxDisplayString(
+ process.env['SANDBOX'],
+ config.getSandboxEnabled(),
+ isTrustedFolder,
+ );
addCol(
id,