{"record":{"id":"b51ad9c66f2159f4","repo":"junegunn/fzf","slug":"unable-to-put-non-printable-character","errorCode":null,"errorMessage":"unable to put non-printable character","messagePattern":"unable to put non-printable character","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":1959,"sourceCode":"\t\tcase \"preview-down\":\n\t\t\tappendAction(actPreviewDown)\n\t\tcase \"preview-page-up\":\n\t\t\tappendAction(actPreviewPageUp)\n\t\tcase \"preview-page-down\":\n\t\t\tappendAction(actPreviewPageDown)\n\t\tcase \"preview-half-page-up\":\n\t\t\tappendAction(actPreviewHalfPageUp)\n\t\tcase \"preview-half-page-down\":\n\t\t\tappendAction(actPreviewHalfPageDown)\n\t\tcase \"enable-search\":\n\t\t\tappendAction(actEnableSearch)\n\t\tcase \"disable-search\":\n\t\t\tappendAction(actDisableSearch)\n\t\tcase \"put\":\n\t\t\tif putAllowed {\n\t\t\t\tappendAction(actChar)\n\t\t\t} else {\n\t\t\t\treturn nil, errors.New(\"unable to put non-printable character\")\n\t\t\t}\n\t\tcase \"wait\":\n\t\t\tappendAction(actWait)\n\t\tcase \"bell\":\n\t\t\tappendAction(actBell)\n\t\tcase \"exclude\":\n\t\t\tappendAction(actExclude)\n\t\tcase \"exclude-multi\":\n\t\t\tappendAction(actExcludeMulti)\n\t\tcase \"bg-cancel\":\n\t\t\tappendAction(actBgCancel)\n\t\tdefault:\n\t\t\tt := isExecuteAction(specLower)\n\t\t\tif t == actIgnore {\n\t\t\t\tif specIndex == 0 && specLower == \"\" {\n\t\t\t\t\tactions = append(prevActions, actions...)\n\t\t\t\t} else if specLower == \"change-multi\" {\n\t\t\t\t\tappendAction(actChangeMulti)","sourceCodeStart":1941,"sourceCodeEnd":1977,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L1941-L1977","documentation":"Thrown while parsing a --bind action list containing 'put'. The 'put' action types the bound key's literal character into the prompt, so it is only legal when the key itself is a printable character (putAllowed). Binding 'put' to a non-printable key such as f5, ctrl-a, or tab makes no sense and is rejected.","triggerScenarios":"`--bind 'ctrl-a:put'`, `--bind 'f5:put'`, `--bind 'tab:put'` — any 'put' action attached to a key whose event is not printable. putAllowed is false for those keys when parseActionList is called from parseKeymap.","commonSituations":"Copy-pasting a bind line written for a different key (e.g. changing `--bind 'a:put'` to `--bind 'ctrl-a:put'` without realizing 'put' depends on the key glyph); shell scripts that generate bind entries programmatically for arbitrary keys.","solutions":["Bind 'put' only to single printable characters: `--bind 'a:put'`","For non-printable keys use an explicit action like 'insert-character' alternatives (e.g. execute(...) or transform) instead of 'put'","If you wanted to paste from clipboard, use the clipboard actions (e.g. paste) rather than 'put'"],"exampleFix":"# before\nfzf --bind 'ctrl-a:put'\n# after\nfzf --bind 'a:put'","handlingStrategy":"validation","validationCode":"# bash: only single printable chars may carry 'put'\nbind_put_ok() {\n  # $1 = key; single character and not a control char\n  [ \"${#1}\" -eq 1 ] && [[ \"$1\" =~ [[:print:]] ]] && ! [[ \"$1\" =~ [[:cntrl:]] ]]\n}\nbind_put_ok \"$KEY\" && fzf --bind \"$KEY:put\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never bind 'put' to named keys (ctrl-*, f1-f12, tab); only to literal glyphs","Review bind generators: whitelist 'put' for [a-zA-Z0-9] style keys only"],"tags":["fzf","go","cli","keybinding","bind"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}