mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
add TERM_PROGRAM and TERM_PROGRAM_VERSION env vars (#350)
* add `TERM_PROGRAM` and `TERM_PROGRAM_VERSION` env vars MacOS's Terminal.app sets these same env variables. They're useful to be able to sniff out the type of terminal emulator and do different settings in your bashrc / vimrc / etc. configuration files. So for example, `TERM_PROGRAM` will be "HyperTerm", and `TERM_PROGRAM_VERSION` will be the value from `package.json/version`. * fix require package.json path
This commit is contained in:
parent
db7aed53ad
commit
5fcf250c04
1 changed files with 4 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ const { app } = require('electron');
|
||||||
const { EventEmitter } = require('events');
|
const { EventEmitter } = require('events');
|
||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
const defaultShell = require('default-shell');
|
const defaultShell = require('default-shell');
|
||||||
|
const { productName, version } = require('./package');
|
||||||
|
|
||||||
let spawn;
|
let spawn;
|
||||||
try {
|
try {
|
||||||
|
|
@ -27,7 +28,9 @@ module.exports = class Session extends EventEmitter {
|
||||||
cwd,
|
cwd,
|
||||||
env: Object.assign({}, process.env, {
|
env: Object.assign({}, process.env, {
|
||||||
LANG: app.getLocale(),
|
LANG: app.getLocale(),
|
||||||
TERM: 'xterm-256color'
|
TERM: 'xterm-256color',
|
||||||
|
TERM_PROGRAM: productName,
|
||||||
|
TERM_PROGRAM_VERSION: version
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue