improved (full color) sandbox, mount /tmp to display build warnings, display sandbox name in footer (#96)

This commit is contained in:
Olcan 2025-04-21 14:43:43 -07:00 committed by GitHub
parent 7663ccf0bd
commit 319f211211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 33 additions and 3 deletions

View File

@ -19,8 +19,14 @@ export const Footer: React.FC<FooterProps> = ({
debugMode, debugMode,
debugMessage, debugMessage,
}) => ( }) => (
<Box marginTop={1} justifyContent="space-between"> <Box
<Box minWidth={15}> marginTop={1}
display="flex"
justifyContent="space-between"
width="100%"
>
{/* Left Section: Help/DebugMode */}
<Box>
<Text color={Colors.SubtleComment}> <Text color={Colors.SubtleComment}>
{queryLength === 0 ? '? for shortcuts' : ''} {queryLength === 0 ? '? for shortcuts' : ''}
{debugMode && ( {debugMode && (
@ -28,6 +34,24 @@ export const Footer: React.FC<FooterProps> = ({
)} )}
</Text> </Text>
</Box> </Box>
<Text color={Colors.AccentBlue}>Gemini</Text>
{/* Middle Section: Centered Sandbox Info */}
<Box
flexGrow={1}
alignItems="center"
justifyContent="center"
display="flex"
>
{process.env.SANDBOX ? (
<Text color="green"> {process.env.SANDBOX} </Text>
) : (
<Text color="red"> WARNING: OUTSIDE SANDBOX </Text>
)}
</Box>
{/* Right Section: Gemini Label */}
<Box>
<Text color={Colors.AccentBlue}>Gemini</Text>
</Box>
</Box> </Box>
); );

View File

@ -36,6 +36,9 @@ run_args=(-it --rm)
# mount current directory as $WORKDIR inside container # mount current directory as $WORKDIR inside container
run_args+=(-v "$PWD:$WORKDIR") run_args+=(-v "$PWD:$WORKDIR")
# mount $TMPDIR as /tmp inside container
run_args+=(-v "$TMPDIR:/tmp")
# name container after image, plus numeric suffix to avoid conflicts # name container after image, plus numeric suffix to avoid conflicts
INDEX=0 INDEX=0
while $CMD ps -a --format "{{.Names}}" | grep -q "$IMAGE-$INDEX"; do while $CMD ps -a --format "{{.Names}}" | grep -q "$IMAGE-$INDEX"; do
@ -46,6 +49,9 @@ run_args+=(--name "$IMAGE-$INDEX" --hostname "$IMAGE-$INDEX")
# also set SANDBOX environment variable as container name # also set SANDBOX environment variable as container name
run_args+=(--env "SANDBOX=$IMAGE-$INDEX") run_args+=(--env "SANDBOX=$IMAGE-$INDEX")
# pass TERM and COLORTERM to container to maintain terminal colors
run_args+=(--env "TERM=$TERM" --env "COLORTERM=$COLORTERM")
# enable debugging via node --inspect-brk (and $DEBUG_PORT) if DEBUG is set # enable debugging via node --inspect-brk (and $DEBUG_PORT) if DEBUG is set
node_args=() node_args=()
if [ -n "${DEBUG:-}" ]; then if [ -n "${DEBUG:-}" ]; then