Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/labhanshagrawal/xterm-link-provider
Create a link provider for xterm.js using regex
https://github.com/labhanshagrawal/xterm-link-provider
Last synced: 3 days ago
JSON representation
Create a link provider for xterm.js using regex
- Host: GitHub
- URL: https://github.com/labhanshagrawal/xterm-link-provider
- Owner: LabhanshAgrawal
- License: mit
- Created: 2021-02-14T13:24:38.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-30T23:01:52.000Z (almost 2 years ago)
- Last Synced: 2024-12-18T22:37:21.980Z (10 days ago)
- Language: TypeScript
- Size: 21.5 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xterm-link-provider
Create a [Link Provider](https://github.com/xtermjs/xterm.js/blob/a73fe62b7aedcd331e01130b92d7e753bb5be55b/typings/xterm.d.ts#L1125) for [xterm.js](https://github.com/xtermjs/xterm.js/) using regex (based on xterm-addon-web-links' WebLinkProvider [class](https://github.com/xtermjs/xterm.js/blob/bd6676d3b6d5404e9cf46c3882f543de2fae963f/addons/xterm-addon-web-links/src/WebLinkProvider.ts))
[![npm](https://img.shields.io/npm/v/xterm-link-provider?style=for-the-badge)](https://www.npmjs.com/package/xterm-link-provider)
[![unpkg](https://img.shields.io/badge/dynamic/json?label=unpkg&query=$.version&url=https%3A%2F%2Funpkg.com%2Fxterm-link-provider%40latest%2Fpackage.json&style=for-the-badge&color=orange)](https://unpkg.com/xterm-link-provider@latest/)## Install
```
$ npm install --save xterm-link-provider
```## Usage
```js
import {LinkProvider} from 'xterm-link-provider';// print clicked emojis to console
const emojiRegex = /(\p{Emoji_Presentation}+)/gu
terminal.registerLinkProvider(
new LinkProvider(
terminal,
emojiRegex,
(e, text) => {
console.log(text)
}
)
)
```