Skip to content

Commit

Permalink
pass clean env to pty process (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
atinylittleshell committed Jan 21, 2024
1 parent 5285593 commit 3435721
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 15 deletions.
1 change: 1 addition & 0 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"node-loader": "^2.0.0",
"node-pty": "^1.0.0",
"os-locale": "^6.0.2",
"shell-env": "^4.0.1",
"vm": "^0.1.0",
"webpack": "^5.72.0",
"winston": "^3.8.2"
Expand Down
6 changes: 3 additions & 3 deletions apps/app/src/nativeBridge/modules/terminalModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class PTYInstance {
cols: cols,
rows: rows,
cwd: startupDirectory || os.homedir() || process.cwd(),
env: {
...process.env,
// eslint-disable-next-line @typescript-eslint/no-var-requires
env: Object.assign({}, require('shell-env').shellEnvSync(shell), {
LANG: `${osLocaleSync().replace(/-/, '_')}.UTF-8`,
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
TERM_PROGRAM: app.name,
TERM_PROGRAM_VERSION: app.getVersion(),
},
}),
});

Logger.getInstance().log(
Expand Down
3 changes: 3 additions & 0 deletions apps/app/webpack.preload.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = {
},
externals: {
electron: 'commonjs electron',
'node:os': 'commonjs os',
'node:process': 'commonjs process',
},
plugins: [
new webpack.NormalModuleReplacementPlugin(
Expand Down Expand Up @@ -51,6 +53,7 @@ module.exports = {
fallback: {
assert: false,
buffer: false,
child_process: false,
console: false,
constants: false,
crypto: false,
Expand Down
67 changes: 56 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terminalone/monorepo",
"productName": "Terminal One",
"version": "1.5.0",
"version": "1.5.1",
"description": "A fast, elegant and intelligent cross-platform terminal.",
"author": "atinylittleshell <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit 3435721

Please sign in to comment.