Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NordicPlayground/pc-xterm-lib
https://github.com/NordicPlayground/pc-xterm-lib
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/NordicPlayground/pc-xterm-lib
- Owner: NordicPlayground
- License: other
- Created: 2021-01-11T11:05:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-27T09:58:06.000Z (over 2 years ago)
- Last Synced: 2024-08-03T13:14:44.140Z (3 months ago)
- Language: JavaScript
- Size: 1010 KB
- Stars: 2
- Watchers: 16
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pc-xterm-lib
This library implements a set of useful features for a rich terminal experience. It is implemented as a modular set of addons for the main [XTerm.js library](https://github.com/xtermjs/xterm.js), so it can be used by any application which uses XTerm.js and would benefit from a terminal with these features.
It should not be considered remotely production ready; there are lots of bugs and missing features, and a lot of polish needed before it can be used in a real application.
## Features
- [x] Autocompletion
- [x] Copy and paste support
- [x] Command history
- [x] Optional timestamps
- [ ] Contextual information on hover
- [ ] Custom styling of defined text / input via regex
- [ ] Probably lots more## Usage
Since the library is a normal XTerm addon, usage is as straightforward as initialising it and passing it to your terminal's `loadAddon` method:
```typescript
import { Terminal } from 'xterm';
import { NrfTerminalCommander, NrfTerminalConfig } from 'pc-xterm-lib';const config: NrfTerminalConfig = {
completions: [
{
name: 'my_custom_command',
description: 'Does something interesting',
},
],
commands: {
my_custom_command: () => {
console.log('Doing something...');
},
},
prompt: 'AT[:lineCount]>',
showTimestamps: true,
};const nrfTerminalCommander = new NrfTerminalCommander(config);
const terminal = new Terminal();
terminal.loadAddon(nrfTerminalCommander);
```## Architecture
Please see the diagram below and [this presentation](docs/XTerm_Presentation.pdf) for information on how the library is structured.
![architecture_no_alpha](docs/architecture.png)
## Feedback
Please report issues to the Wayland team.
## License
See the [LICENSE](LICENSE) file for details.