{"id":21801475,"url":"https://github.com/px86/linereader","last_synced_at":"2026-05-21T05:34:42.578Z","repository":{"id":43209600,"uuid":"457440437","full_name":"px86/linereader","owner":"px86","description":"C++ library providing line-editing and history capabilities for interactive command line programs.","archived":false,"fork":false,"pushed_at":"2022-03-13T16:36:04.000Z","size":47,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T03:42:10.983Z","etag":null,"topics":["line-editing","line-editor","readline"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/px86.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-09T16:33:04.000Z","updated_at":"2024-06-29T08:00:56.000Z","dependencies_parsed_at":"2022-09-09T23:21:05.660Z","dependency_job_id":null,"html_url":"https://github.com/px86/linereader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/px86%2Flinereader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/px86%2Flinereader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/px86%2Flinereader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/px86%2Flinereader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/px86","download_url":"https://codeload.github.com/px86/linereader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244752355,"owners_count":20504255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["line-editing","line-editor","readline"],"created_at":"2024-11-27T11:18:10.990Z","updated_at":"2026-05-21T05:34:37.560Z","avatar_url":"https://github.com/px86.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: LineReader - A C++ Library For Line Editing\n#+AUTHOR: Pushkar Raj\n\n* About\n\n=LineReader= is a C++ library that provides line-editing, and history capabilities for interactive command line programs.\n\n* Usage\n\nInclude the =linereader.hpp= file, and  compile the =linereader.cpp= file together with your project.\n\nTo use =LineReader= in you project,\n\n#+begin_src cpp\n  #include \"linereader.hpp\"\n  #include \u003ciostream\u003e\n\n  int main(int argc, char **argv) {\n    auto lr = LineReader(\".history_file\");\n    \n    const char *prompt = \"\u003e \";\n    while (lr) {\n      auto cmd = lr.readline(prompt);\n      if (!cmd.empty()) {\n        // parse and execute the command string.\n        // ...\n      }\n    }\n    std::cout \u003c\u003c '\\n' \u003c\u003c \"Bye!\" \u003c\u003c std::endl;\n\n    return 0;\n  }\n#+end_src\n\n* Key Bindings\n\n- =C-f= is for =Ctrl + f=\n- =M-f= is for =Alt + f=\n\n| Key                | Action                                                            |\n|--------------------+-------------------------------------------------------------------|\n| C-f or Right Arrow | move forward one character                                        |\n| C-b or Left Arrow  | move backward one character                                       |\n| M-f                | move forward one word                                             |\n| M-b                | move backward one word                                            |\n| C-d or Delete      | delete one character                                              |\n| M-d                | delete one word                                                   |\n| C-p or Up Arrow    | edit previous line in history                                     |\n| C-n or Down Arrow  | edit next line in history                                         |\n| M-l                | lowercase word                                                    |\n| M-u                | uppercase word                                                    |\n| M-c                | capitalize word                                                   |\n| C-t                | swap current character with previous character                    |\n| M-t                | swap words                                                        |\n| C-u                | kill (cut) text from cursor position to the beginning of the line |\n| C-k                | kill (cut) text from cursor position to the end of the line       |\n| C-y                | yank (paste) text from kill ring                                  |\n| M-y                | (after C-y) cycle through kill ring                               |\n\n* Notes\n\n- Terminal escape sequences have been tested on =xterm= only.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpx86%2Flinereader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpx86%2Flinereader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpx86%2Flinereader/lists"}