{"id":22065989,"url":"https://github.com/iij/mruby-editline","last_synced_at":"2026-05-17T19:06:32.826Z","repository":{"id":146123554,"uuid":"113128350","full_name":"iij/mruby-editline","owner":"iij","description":"mruby binding for EditLine library","archived":false,"fork":false,"pushed_at":"2020-09-24T06:43:45.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-12T03:02:17.548Z","etag":null,"topics":["editline","mruby"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-05T03:39:03.000Z","updated_at":"2020-09-24T06:43:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e054d27-e8a0-4fa2-a169-674cc958e183","html_url":"https://github.com/iij/mruby-editline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iij/mruby-editline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-editline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-editline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-editline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-editline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iij","download_url":"https://codeload.github.com/iij/mruby-editline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iij%2Fmruby-editline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33151625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["editline","mruby"],"created_at":"2024-11-30T19:22:59.097Z","updated_at":"2026-05-17T19:06:32.808Z","avatar_url":"https://github.com/iij.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mruby-editline\nmruby binding for [editline(3)](http://netbsd.gw.com/cgi-bin/man-cgi?editline++NetBSD-current) library.\n\n## Usage\n```rb\nel = EditLine.new\nel.set_prompt \"prompt\u003e \"\n\nel.set_addfn(\"mruby-editline-sample-complete\", \"complete a word\") do |ch|\n  el.insertstr \"hello!\"\n  EditLine::CC_REFRESH\nend\nel.set_bind(\"^I\", \"mruby-editline-sample-complete\")\n\nwhile line = el.gets\n  puts \"cmd =\u003e\" + line\nend\n```\n\n## API Reference\n### EditLine class\n- `.new`\n  - Create a new EditLine instance. (`el_init`)\n- `#gets -\u003e String|nil`\n  - Read a line from the tty.  Returns the line read if successful, returns\n    nil if no characters were read, or raises a RuntimeError if an error\n    occurred. (`el_gets`)\n- `#deletestr(str)`\n  - Delete `count` characters before the cursor.\n- `#insertstr(str) -\u003e Fixnum`\n  - Insert str into the line at the cursor.  Returns -1 if str is empty or\n    won't fit, and 0 otherwise. (`el_insertstr`)\n- `#line -\u003e [String, Fixnum]`\n  - Return the current line and the position of cursor. (`el_line`)\n- `#parse(argv) -\u003e Fixnum`\n  - Parses the `argv` array to execute builtin editline commands.  If the\n    command is prefixed with \"prog:\" then el_parse() will only execute\n    the command if \"prog\" matches the prog argument supplied to el_init().\n    The return value is -1 if the command is unknown, 0 if there was no\n    error or \"prog\" didn't match, or 1 if the command returned\n    an error.  Refer to editrc(5) for more information. (`el_parse`)\n- `#push(str)`\n  - Pushes str back onto the input stream.  This is used by the macro\n    expansion mechanism.  Refer to the description of bind -s in\n    [editrc(5)](http://netbsd.gw.com/cgi-bin/man-cgi?editrc++NetBSD-current)\n    for more information.\n- `#resize`\n  - Must be called if the terminal size changes.  If `#set_signal(flag)`\n    has been called with non-zero `flag`, then this is done automatically.\n    Otherwise, it's the responsibility of the application to call\n    `el_resize()` on the appropriate occasions. (`el_resize`)\n- `#set_addfn(name, help, \u0026proc)`\n  - add an user defined function `name`.  `help` is a description of it.\n    `proc` is a callback function.  The return value of `proc` should be\n    one of EditLine::CC_nnn. (`el_set(EL_ADDFN)`)\n  - Caveats: You cannot define more than 10 functions.  If you need more,\n    change lines around the definition of `USERFUNCTIONS` in src/editline.c.\n- `#set_bind(key, proc)`\n  - `proc` can be String or Proc. (`el_set(EL_BIND)`)\n- `#set_prompt(proc, c=nil)`\n  - Define prompt printing function as `proc`, which is to return a string\n    that contains the prompt. (`el_set(EL_PROMPT)`, `el_set(EL_PROMPT_ESC)`)\n    - Note: ANSI escape sequence in prompt string does not work as expected\n      due to a bug in editline library.\n- `#set_setty(*args) -\u003e Fixnum`\n  - Perform the setty builtin command.  Refer to editrc(5) for more\n    information. (`el_set(EL_SETTY)`)\n- `#set_signal(flag) -\u003e Fixnum`\n  - If flag is non-zero, editline will install its own signal handler\n    for the following signals when reading command input: SIGCONT,\n    SIGHUP, SIGINT, SIGQUIT, SIGSTOP, SIGTERM, SIGTSTP, and SIGWINCH.\n    Otherwise, the current signal handlers will be used.\n    (`el_set(EL_SIGNAL)`)\n- `#get_gettc(name) -\u003e String|Fixnum`\n  - If name is a valid termcap(5) capability, return the current value of\n    that capability. (`el_get(EL_GETTC)`)\n    - If not, raises an ArgumentError.\n\n(Descriptions above are from [editline(3) manual page](http://netbsd.gw.com/cgi-bin/man-cgi?editline++NetBSD-current).)\n\n\n## License\nCopyright (c) 2017 Internet Initiative Japan Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiij%2Fmruby-editline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiij%2Fmruby-editline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiij%2Fmruby-editline/lists"}