https://github.com/thebespokepixel/term-ng
Terminal/$TERM feature snooping and whitelisting
https://github.com/thebespokepixel/term-ng
24-bit node-module npm sgr termcap terminal
Last synced: 18 days ago
JSON representation
Terminal/$TERM feature snooping and whitelisting
- Host: GitHub
- URL: https://github.com/thebespokepixel/term-ng
- Owner: thebespokepixel
- License: mit
- Created: 2015-12-31T09:30:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-11-10T16:48:42.000Z (6 months ago)
- Last Synced: 2024-11-10T17:37:32.472Z (6 months ago)
- Topics: 24-bit, node-module, npm, sgr, termcap, terminal
- Language: JavaScript
- Homepage: https://thebespokepixel.github.io/term-ng
- Size: 20.2 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# term-ng
>Enables enhanced node.js/fish-shell/XTerm/iTerm3 feature integration.##### Publishing Status
[](https://www.npmjs.com/package/term-ng "npm") [](https://libraries.io/github/thebespokepixel/term-ng "Libraries.io")
[](https://travis-ci.com/thebespokepixel/term-ng "Travis") [](https://github.com/rollup/rollup/wiki/pkg.module "Rollup")##### Development Status
[](https://travis-ci.com/thebespokepixel/term-ng "Travis") [](https://libraries.io/github/thebespokepixel/term-ng "Libraries.io")
[](https://snyk.io/test/github/thebespokepixel/term-ng "Snyk") [](https://codeclimate.com/github/thebespokepixel/term-ng/maintainability "Code-Climate") [](https://codeclimate.com/github/thebespokepixel/term-ng/test_coverage "Code-Climate Coverage")##### Documentation/Help
[](https://inch-ci.org/github/thebespokepixel/term-ng "Inch.io") [](https://twitter.com/thebespokepixel "Twitter")
## TermNG (Next Generation)
- Senses 24bit colour (truecolor) when `$TERM_COLOR=16m` environment variable is set.
- Adds `--color=16m` to front of process.argv before wrapping the `supports-color` module.
- Indicate enhanced media support by setting:
+ `$TERM_IMAGES=enabled` : Allow rendering of inline images using OSC sequences.
+ `$TERM_AUDIO=enabled` : Allow enhanced audio.
- Indicate that you use a font that has box drawing or full extended characters.
+ `$TERM_FONT=box` : Terminal font has UTF8 box drawing characters.
+ `$TERM_FONT=full` : Terminal font has full UTF8 extras (such as Menlo, DejaVu Mono).
- Sense $TERM suffixes to indicate enhanced termcap capabilities.In fish, it's a simple as defining a universal, exported variable.
```shell
set -Ux TERM_IMAGES enabled
set -Ux TERM_FONT full
```In bash an `export TERM_IMAGES=enabled` in `~/.bashrc` will do the trick. I don't use tcsh or zsh anymore so can't remember exactly which files are used when those shells are invoked interactively. Fish is almost always invoked interactively - which is kind of the point of fish, it being the 'Friendly INTERACTIVE Shell' after all! Write scripts for portablility (sh/bash/perl even node) then write fish functions to interact with those scripts from the keyboard... but I digress.
### Usage
### Terminal Color Test
From inside the package directory, running `npm run-script colors` will generate a preview of the entire color gamut your terminal is capable of. Output of a recent iTerm shown below:
![Color preview][colors]
[colors]: https://raw.githubusercontent.com/thebespokepixel/term-ng/master/media/colors.png
## Documentation
Full documentation can be found at [https://thebespokepixel.github.io/term-ng/][1][1]: https://thebespokepixel.github.io/term-ng/