{"record":{"id":"94b7cae1b0250075","repo":"slopus/happy","slug":"invalid-pane-identifier-result-pane-only-nu","errorCode":null,"errorMessage":"Invalid pane identifier: \"${result.pane}\". Only numeric values are allowed.","messagePattern":"Invalid pane identifier: \"(.+?)\"\\. Only numeric values are allowed\\.","errorType":"validation","errorClass":"TmuxSessionIdentifierError","httpStatus":null,"severity":"error","filePath":"packages/happy-cli/src/utils/tmux.ts","lineNumber":154,"sourceCode":"    };\n\n    // Validate session name (tmux has restrictions on session names)\n    if (!/^[a-zA-Z0-9._-]+$/.test(result.session)) {\n        throw new TmuxSessionIdentifierError(`Invalid session name: \"${result.session}\". Only alphanumeric characters, dots, hyphens, and underscores are allowed.`);\n    }\n\n    if (parts.length > 1) {\n        const windowAndPane = parts[1].split('.');\n        result.window = windowAndPane[0]?.trim();\n\n        if (result.window && !/^[a-zA-Z0-9._-]+$/.test(result.window)) {\n            throw new TmuxSessionIdentifierError(`Invalid window name: \"${result.window}\". Only alphanumeric characters, dots, hyphens, and underscores are allowed.`);\n        }\n\n        if (windowAndPane.length > 1) {\n            result.pane = windowAndPane[1]?.trim();\n            if (result.pane && !/^[0-9]+$/.test(result.pane)) {\n                throw new TmuxSessionIdentifierError(`Invalid pane identifier: \"${result.pane}\". Only numeric values are allowed.`);\n            }\n        }\n    }\n\n    return result;\n}\n\n// Helper to format tmux session identifier to string\nexport function formatTmuxSessionIdentifier(identifier: TmuxSessionIdentifier): string {\n    if (!identifier.session) {\n        throw new TmuxSessionIdentifierError('Session identifier must have a session name');\n    }\n\n    let result = identifier.session;\n    if (identifier.window) {\n        result += `:${identifier.window}`;\n        if (identifier.pane) {\n            result += `.${identifier.pane}`;","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/utils/tmux.ts#L136-L172","documentation":"If the identifier specifies a pane ('session:window.pane'), parseTmuxSessionIdentifier requires the pane segment to match /^[0-9]+$/ and throws this TmuxSessionIdentifierError otherwise, since tmux pane indices are numeric.","triggerScenarios":"Calling parseTmuxSessionIdentifier with a non-numeric pane like 'happy:0.main', 'happy:0.%3', or 'happy:0.0.extra' where the extra segment yields a non-numeric pane token.","commonSituations":"Confusing tmux pane IDs (%N) with pane indices; passing a pane title instead of the index; copying a target string that includes extra dot-separated fields.","solutions":["Use the numeric pane index: 'happy:0.1' not 'happy:0.%1'.","Omit the pane segment and target the window only: 'happy:0'.","Look up the correct index with tmux list-panes -a.","Strip non-numeric suffixes from the pane token before parsing."],"exampleFix":"// before\nparseTmuxSessionIdentifier('happy:0.%3'); // throws\n// after\nparseTmuxSessionIdentifier('happy:0.3');","handlingStrategy":"validation","validationCode":"const pane = identifier.split(':')[1]?.split('.')[1];\nif (pane !== undefined && !/^\\d+$/.test(pane)) {\n  throw new Error(`Pane '${pane}' must be a numeric index, not '%N'`);\n}\nparseTmuxSessionIdentifier(identifier);","typeGuard":"function isNumericPane(pane: string | undefined): boolean {\n  return pane === undefined || /^\\d+$/.test(pane);\n}","tryCatchPattern":"try {\n  return parseTmuxSessionIdentifier(identifier);\n} catch (err) {\n  if (err instanceof TmuxSessionIdentifierError && /pane identifier/.test(err.message)) {\n    return parseTmuxSessionIdentifier(identifier.split('.').slice(0, 2).join('.'));\n  }\n  throw err;\n}","preventionTips":["Remember pane indices are 0-based numbers; %N is a pane ID, not an index.","Resolve indices with `tmux list-panes -F '#{pane_index}'` before targeting.","Strip extra dot-separated fields from copied target strings."],"tags":["tmux","validation"],"backgroundTag":"invalid-tmux-session-identifier","analyzedSha":"b824cd0a4681d41af631a8e422a813873e4455b0","analyzedAt":"2026-08-31T23:12:36.205Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}