Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home dir error #903

Closed
blue-bird1 opened this issue Nov 13, 2018 · 3 comments · Fixed by #937
Closed

home dir error #903

blue-bird1 opened this issue Nov 13, 2018 · 3 comments · Fixed by #937
Labels
Milestone

Comments

@blue-bird1
Copy link
Contributor

Electerm version:

0.25.21

Operating system(linux, macos, or windows?):

windows

Expected Behavior

localshell in home dir .

Current Behavior

localshell in download electerm dir

Possible Solution

diff --git a/app/lib/terminal.js b/app/lib/terminal.js
index 4e4d25b..5360c2e 100644
--- a/app/lib/terminal.js
+++ b/app/lib/terminal.js
@@ -27,11 +27,12 @@ class Terminal {
     let {platform} = process
     let exe = platform.startsWith('win') ? 'powershell.exe' : 'bash'
     let argv = platform.startsWith('darwin') ? ['--login'] : []
+    let home = platform.startsWith('win') ? process.env.USERPROFILE : process.env.HOME
     this.term = pty.spawn(exe, argv, {
       name: 'xterm-color',
       cols: cols || 80,
       rows: rows || 24,
-      cwd: process.env.HOME,
+      cwd: home,
       env: process.env
     })
     return Promise.resolve()

Steps to Reproduce

Context (Environment)

Detailed Description

Suggestions?

windows not have process.env.HOME, but have process.env.USERPROFILE :

@zxdong262 zxdong262 added the bug label Nov 13, 2018
@zxdong262 zxdong262 added this to the v0.26 milestone Nov 13, 2018
@zxdong262
Copy link
Member

@blue-bird1 Thanks, I will try.

@blue-bird1
Copy link
Contributor Author

@zxdong262 How should I only build a Windows package in Linux

@zxdong262
Copy link
Member

@blue-bird1 Possible by using wine, or some pre-built docker image, I did build some simpler windows app in linux, but electerm is more complicated, too much trouble I guess, so I use appveyor to do the build.

@zxdong262 zxdong262 mentioned this issue Nov 15, 2018
zxdong262 added a commit that referenced this issue Nov 15, 2018
- fix #943 Auto resize terminal when font setting changes
- fix #921 Fix drag to select from anywhere
- fix #904 [UI] better menu icon
- fix #893 Update default theme color
- fix #894 Add theme save message 
- fix #880 Simplify fetch wrapper
- fix #892 Hide dns helper in history form 
- fix #903 fix windows home dir by @blue-bird1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants