{"record":{"id":"41b54a4715dab1ce","repo":"charmbracelet/vhs","slug":"expected-shift-character-got-literal","errorCode":null,"errorMessage":"Expected shift character, got ${literal}","messagePattern":"Expected shift character, got (.+?)","errorType":"validation","errorClass":"parser.Error","httpStatus":null,"severity":"error","filePath":"parser/parser.go","lineNumber":398,"sourceCode":"//\tE.g.\n//\tShift+A\n//\tShift+Tab\n//\tShift+Enter\nfunc (p *Parser) parseShift() Command {\n\tif p.peek.Type == token.PLUS {\n\t\tp.nextToken()\n\t\tif p.peek.Type == token.STRING ||\n\t\t\tp.peek.Type == token.ENTER ||\n\t\t\tp.peek.Type == token.LEFT_BRACKET ||\n\t\t\tp.peek.Type == token.RIGHT_BRACKET ||\n\t\t\tp.peek.Type == token.TAB {\n\t\t\tc := p.peek.Literal\n\t\t\tp.nextToken()\n\t\t\treturn Command{Type: token.SHIFT, Args: c}\n\t\t}\n\t}\n\n\tp.errors = append(p.errors, NewError(p.cur, \"Expected shift character, got \"+p.cur.Literal))\n\treturn Command{Type: token.SHIFT}\n}\n\n// parseKeypress parses a repeatable and time adjustable keypress command.\n// A keypress command takes an optional typing speed and optional count.\n//\n//\tKey[@<time>] [count]\nfunc (p *Parser) parseKeypress(ct token.Type) Command {\n\tcmd := Command{Type: CommandType(ct)}\n\tcmd.Options = p.parseSpeed()\n\tcmd.Args = p.parseRepeat()\n\treturn cmd\n}\n\n// parseOutput parses an output command.\n// An output command takes a file path to which to output.\n//\n//\tOutput <path>","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/charmbracelet/vhs/blob/c073383b5de0b1f57bf514113029c306bc986539/parser/parser.go#L380-L416","documentation":"Fires in parseShift when a Shift command is not followed by a valid combined key. The parser requires the literal form Shift+<key> where <key> is a string, Enter, Tab, '[' or ']'; any other token after the '+' (or a missing '+' entirely) fails the whitelist and the error is appended to p.errors.","triggerScenarios":"Thrown at parser/parser.go:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the shift combination as Shift+X with a plus sign and a supported key (e.g. Shift+a, Shift+Tab, Shift+Enter, Shift+[)","Quote the character as a string literal if the lexer does not recognize it, e.g. Shift+\"a\"","Use the plain Key command instead if the intended key is not shift-combinable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c073383b5de0b1f57bf514113029c306bc986539","analyzedAt":"2026-09-02T01:53:05.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}