spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / is-on-pane-surface / is-on-pane-surface.ts
12 lines · 501 BRaw
1import type { RenderSurface } from 'claude-code'
2
3/**
4 * Whether a render event comes from a surface that draws the pane: every
5 * one but the mobile app, which has no Select and is not terminal-wide.
6 *
7 * @param e the render event, or anything naming its surface
8 * @returns false on `mobile`, true otherwise, narrowing `e` to the rest
9 */
10export const isOnPaneSurface = <E extends Record<'surface', RenderSurface>>(
11 e: E,
12): e is Exclude<E, Record<'surface', 'mobile'>> => e.surface !== 'mobile'