{"id":13698284,"url":"https://github.com/rse/blessed-xterm","last_synced_at":"2025-03-22T03:06:49.124Z","repository":{"id":66345589,"uuid":"88414118","full_name":"rse/blessed-xterm","owner":"rse","description":"XTerm Widget for Blessed Curses Environment","archived":false,"fork":false,"pushed_at":"2024-09-15T15:33:01.000Z","size":409,"stargazers_count":49,"open_issues_count":6,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-19T15:08:00.560Z","etag":null,"topics":["blessed","curses","emulation","pty","terminal","xterm"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/blessed-xterm","language":"JavaScript","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/rse.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-04-16T13:12:40.000Z","updated_at":"2025-03-11T19:52:03.000Z","dependencies_parsed_at":"2024-04-08T03:03:53.315Z","dependency_job_id":"42f21668-7ae4-4a4e-bc70-806a390fbc6b","html_url":"https://github.com/rse/blessed-xterm","commit_stats":{"total_commits":131,"total_committers":1,"mean_commits":131.0,"dds":0.0,"last_synced_commit":"a7b5f39539bb0e985251fcfe8bf3d12edf3518fb"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fblessed-xterm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fblessed-xterm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fblessed-xterm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fblessed-xterm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rse","download_url":"https://codeload.github.com/rse/blessed-xterm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244450125,"owners_count":20454598,"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":["blessed","curses","emulation","pty","terminal","xterm"],"created_at":"2024-08-02T19:00:43.049Z","updated_at":"2025-03-22T03:06:49.105Z","avatar_url":"https://github.com/rse.png","language":"JavaScript","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"\nBlessed-XTerm\n=============\n\n**XTerm Widget for Blessed Curses Environment**\n\n\u003cp/\u003e\n\u003cimg src=\"https://nodei.co/npm/blessed-xterm.png?downloads=true\u0026stars=true\" alt=\"\"/\u003e\n\n\u003cp/\u003e\n\u003cimg src=\"https://david-dm.org/rse/blessed-xterm.png\" alt=\"\"/\u003e\n\nAbstract\n--------\n\nThis is an XTerm emulating terminal widget for the awesome\n[Blessed](https://github.com/chjj/blessed) Curses environment of\nNode.js. It allows the execution of interactive terminal programs in a\nBlessed Box-derived widget while providing a full-featured and fully\ncompatible emulated XTerm rendering environment to those programs.\n\nBlessed XTerm is actually a more modern variant of the Terminal widget\nas shipped with the Blessed Curses environment. The difference to the\nregular Terminal widget is: (1) the Blessed XTerm widget uses the\nnewer and more portable [node-pty](https://github.com/Tyriar/node-pty)\nmodule, instead of the ancient [pty.js](https://github.com/chjj/pty.js/)\nmodule, for Pseudo TTY management, (2) it uses the newer and more\nsophisticated [XTerm.js](https://xtermjs.org/) module, instead of the\nancient [Term.js](https://github.com/chjj/term.js/) module, for XTerm\nemulation, (3) it provides full scrollback buffer support and (4) it\nsupports starting and stopping multiple commands while the widget is\nactive.\n\nTo see Blessed XTerm in action, check out [stmux](https://github.com/rse/stmux),\nthe utility for which Blessed XTerm originally was developed for.\n\nExample\n-------\n\n![Blessed XTerm Sample usage](screenshot.png)\n\nInstallation\n------------\n\n```\n$ npm install blessed blessed-xterm\n```\n\nNOTICE: The `node-pty` dependency module is a Node.js module with\na native C/C++ component. For this a C/C++ compiler environment is\nrequired during `npm install`. For macOS, ensure you have Apple XCode\nand its Command-Line Tools installed (you can find them in XCode\nunder menu `Xcode` / `Preferences` / `Downloads`). For Windows,\nyou need Microsoft's Visual C/C++ Build Tools installed (you can\nconveniently install them with `npm install --global --production\nwindows-build-tools` from an elevated shell).\n\nUsage\n-----\n\nThe Blessed XTerm widget supports all configuration options of\n[Blessed Box](https://github.com/chjj/blessed#box-from-element),\n[Blessed Element](https://github.com/chjj/blessed#element-from-node),\n[Blessed Node](https://github.com/chjj/blessed#node-from-eventemitter) and\n[Node.js EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter),\nplus the following ones:\n\n- `shell` (default: `process.env.SHELL || \"sh\"`):\u003cbr/\u003e\n  The shell to execute.\n- `args` (default: `[]`):\u003cbr/\u003e\n  The arguments for the shell to execute.\n- `env` (default: `process.env`):\u003cbr/\u003e\n  The environment variables for the shell to execute.\n- `cwd` (default: `process.cwd()`):\u003cbr/\u003e\n  The current working directory for the shell to execute.\n- `cursorType` (default: `block`):\u003cbr/\u003e\n  The type of cursor. Either `block`, `underline` or `line`.\n- `scrollback` (default: `1000`):\u003cbr/\u003e\n  The amount of lines for scrolling back.\n- `controlKey` (default: `C-w`):\u003cbr/\u003e\n  The control key to enter the scrolling mode.\n- `ignoreKeys` (default: `[]`):\u003cbr/\u003e\n  The keys to ignore.\n- `mousePassthrough` (default: `false`):\u003cbr/\u003e\n  The mouse events are captured and passed-through to\n  the XTerm emulation as mouse key sequences.\n- `style.scrolling.border.fg` (default: `red`):\u003cbr/\u003e\n  The color of the border during scrolling mode.\n\nThe Blessed XTerm widget supports all methods of\n[Blessed Box](https://github.com/chjj/blessed#box-from-element),\n[Blessed Element](https://github.com/chjj/blessed#element-from-node),\n[Blessed Node](https://github.com/chjj/blessed#node-from-eventemitter) and\n[Node.js EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter),\nplus the following ones:\n\n- `enableInput(enable: Boolean): Void`:\u003cbr/\u003e\n  Enable or disable the input handling.\n- `injectInput(input: String): Void`:\u003cbr/\u003e\n  Inject input into the terminal as it was typed by the user.\n  The input is actually sent to the executed program.\n- `write(output: String): Void`:\u003cbr/\u003e\n  Write output to the terminal as it was output by the executed program.\n  The output is just displayed.\n- `getScrollHeight(): Number`:\u003cbr/\u003e\n  Get the actual height in lines of the scrolling area.\n- `getScroll(): Number`:\u003cbr/\u003e\n  Get the current scroll index in lines.\n- `setScroll(index: Number): Void`:\u003cbr/\u003e\n  Scroll the content to an absolute index in lines (same as scrollTo).\n- `scrollTo(index: Number): Void`:\u003cbr/\u003e\n  Scroll the content to an absolute index in lines (same as setScroll).\n- `getScrollPerc(): Number`:\u003cbr/\u003e\n  Get the current scroll index in percentage (0-100).\n- `setScrollPerc(percent: Number): Void`:\u003cbr/\u003e\n  Set the current scroll index in percentage (0-100).\n- `scroll(offset: Number): Void`:\u003cbr/\u003e\n  Scroll the content by a relative offset of lines.\n- `resetScroll(): Void`:\u003cbr/\u003e\n  Reset the scrolling by scrolling to the bottom of the scroll buffer.\n- `spawn (shell: String, args: String[], cwd?: String, env?: Object): Void`:\u003cbr/\u003e\n  Spawn/run a command, optionally first terminating a currently running one.\n- `terminate(): Void`:\u003cbr/\u003e\n  Terminate a currently running/spawned program.\n- `kill(): Void`:\u003cbr/\u003e\n  Tear down the widget.\n\nThe Blessed XTerm widget supports all events of\n[Blessed Box](https://github.com/chjj/blessed#box-from-element),\n[Blessed Element](https://github.com/chjj/blessed#element-from-node),\n[Blessed Node](https://github.com/chjj/blessed#node-from-eventemitter) and\n[Node.js EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter),\nplus the following ones:\n\n- `title` (`title: String`):\u003cbr/\u003e\n  The program output a sequence to update the terminal with `title`.\n- `beep` ():\u003cbr/\u003e\n  The program output a sequence to beep the terminal.\n- `scrolling-start` ():\u003cbr/\u003e\n  The scrolling mode was started.\n- `scrolling-end` ():\u003cbr/\u003e\n  The scrolling mode was ended.\n- `scroll` ():\u003cbr/\u003e\n  The content was scrolled.\n- `exit` (`code: Number`):\u003cbr/\u003e\n  The spawned program terminated with `code`.\n  Usually used in combination with the Blessed XTerm `spawn()` method.\n- `update` ():\u003cbr/\u003e\n  The rendering engine just updated the widget content.\n  Usually used in combination with the Blessed Element `screenshot()` method.\n\nLicense\n-------\n\nCopyright (c) 2017-2024 Dr. Ralf S. Engelschall (http://engelschall.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fblessed-xterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frse%2Fblessed-xterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fblessed-xterm/lists"}