fix: add CLAUDE_MENU_BAR input validation, docs, and --doctor integration

Follow-up to #251: validate unrecognized CLAUDE_MENU_BAR values with a
warning and fallback to 'auto', document the env var in CONFIGURATION.md,
and report the setting in --doctor diagnostics.

Co-Authored-By: Claude <claude@anthropic.com>
This commit is contained in:
aaddrick
2026-02-28 16:10:18 -05:00
parent 912394d6d1
commit 07c1388a6b
3 changed files with 41 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ Model Context Protocol settings are stored in:
| Variable | Default | Description |
|----------|---------|-------------|
| `CLAUDE_USE_WAYLAND` | unset | Set to `1` to use native Wayland instead of XWayland. Note: Global hotkeys won't work in native Wayland mode. |
| `CLAUDE_MENU_BAR` | unset (`auto`) | Controls menu bar behavior: `auto` (hidden, Alt toggles), `visible` (always shown), `hidden` (always hidden, Alt disabled). See [Menu Bar](#menu-bar) below. |
### Wayland Support
@@ -29,6 +30,24 @@ export CLAUDE_USE_WAYLAND=1
**Important:** Native Wayland mode doesn't support global hotkeys due to Electron/Chromium limitations with XDG GlobalShortcuts Portal. If global hotkeys (Ctrl+Alt+Space) are important to your workflow, keep the default X11 mode.
### Menu Bar
By default, the menu bar is hidden but can be toggled with the Alt key (`auto` mode). On KDE Plasma and other DEs where Alt is heavily used, this can cause layout shifts. Use `CLAUDE_MENU_BAR` to control the behavior:
| Value | Menu visible | Alt toggles | Use case |
|-------|-------------|-------------|----------|
| unset / `auto` | No | Yes | Default — hidden, Alt toggles |
| `visible` | Yes | No | Stable layout, no shift on Alt |
| `hidden` | No | No | Menu fully disabled, Alt free |
```bash
# Always show the menu bar (no layout shift on Alt)
CLAUDE_MENU_BAR=visible claude-desktop
# Or add to your environment permanently
export CLAUDE_MENU_BAR=visible
```
## Application Logs
Runtime logs are available at:

View File

@@ -8,7 +8,12 @@ console.log('[Frame Fix] Wrapper loaded');
// 'auto' - hidden by default, Alt toggles visibility (current default)
// 'visible' - always visible, Alt does not toggle (stable layout)
// 'hidden' - always hidden, Alt does not toggle
const MENU_BAR_MODE = (process.env.CLAUDE_MENU_BAR || 'auto').toLowerCase();
const VALID_MENU_BAR_MODES = ['auto', 'visible', 'hidden'];
const rawMenuBarMode = (process.env.CLAUDE_MENU_BAR || 'auto').toLowerCase();
const MENU_BAR_MODE = VALID_MENU_BAR_MODES.includes(rawMenuBarMode) ? rawMenuBarMode : 'auto';
if (rawMenuBarMode !== MENU_BAR_MODE) {
console.warn(`[Frame Fix] Unknown CLAUDE_MENU_BAR value '${process.env.CLAUDE_MENU_BAR}', falling back to 'auto'. Valid: ${VALID_MENU_BAR_MODES.join(', ')}`);
}
console.log(`[Frame Fix] Menu bar mode: ${MENU_BAR_MODE}`);
// Detect if a window intends to be frameless (popup/Quick Entry/About)

View File

@@ -189,6 +189,22 @@ run_doctor() {
_info 'Fix: Run from within an X11 or Wayland session, not a TTY'
fi
# -- Menu bar mode --
local menu_bar_mode="${CLAUDE_MENU_BAR:-}"
if [[ -n $menu_bar_mode ]]; then
case "${menu_bar_mode,,}" in
auto|visible|hidden)
_pass "Menu bar mode: ${menu_bar_mode,,} (CLAUDE_MENU_BAR=$menu_bar_mode)"
;;
*)
_warn "Unknown CLAUDE_MENU_BAR value: '$menu_bar_mode' (will fall back to 'auto')"
_info "Valid values: auto, visible, hidden"
;;
esac
else
_info 'Menu bar mode: auto (default, Alt toggles visibility)'
fi
# -- Electron binary --
if [[ -n $electron_path && -x $electron_path ]]; then
# Use --no-sandbox and strip ANSI/app output to get just the version