Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Can't Change Terminal Emulator #791

Closed
3 of 10 tasks
SkeleBones opened this issue Oct 25, 2020 · 28 comments
Closed
3 of 10 tasks

Can't Change Terminal Emulator #791

SkeleBones opened this issue Oct 25, 2020 · 28 comments

Comments

@SkeleBones
Copy link

SkeleBones commented Oct 25, 2020

Technical information

Using version:

  • master (running from GitHub-published source code, currently v3.0.0-pre)
  • latest (latest release, currently v2.2.2)
  • vX.X.X (specify other version)

Running on:

  • Linux
  • Windows
  • macOS

How comfortable you are with your system and/or IT in general:

  • I'm kind of lost, honestly
  • I know what's up, I could help you run some commands or checks
  • My machine is fully under my control, tell me what you need
  • I attended Defcon last year

Problem

If I change the shell and restart the terminal, it refuses to launch. If I change it back it doesn't start either. The only way I can start it again after changing it is to delete the settings.json file.

@AkechiShiro
Copy link

I haven't encountered this issue when changing the shell from bash to zsh for instance. What is the shell emulator you're trying to set in the settings.json ?
Also I take it you have bash installed ?

Repository owner deleted a comment from Jr7000750 Oct 27, 2020
@SkeleBones
Copy link
Author

I have bash installed. I am trying to use PowerShell 7-preview. It is installed in the normal place.

@AkechiShiro
Copy link

I'd like to know from what kind of environnement are you trying to launch the terminal is ? Is an X11 server launched ? Or are you trying to launch the terminal in a TTY ?

If you're trying from a TTY then that explains the problem.

@SkeleBones
Copy link
Author

I'm using X11.

@SkeleBones
Copy link
Author

SkeleBones commented Oct 27, 2020

Another thing is it does sort of launch. It just doesn't open fully. I can see it running in the task manager but it never starts the UI. This is after I've tried to change the shell.

@GitSquared
Copy link
Owner

GitSquared commented Oct 27, 2020

What version? (of edex)

@SkeleBones
Copy link
Author

v2.2.2

@parkerlreed
Copy link

#769

Should I submit a new issue?
It depends. As mentioned above, any comeback to this project would start with a code rewrite, effectively eliminating all current bugs (and surely creating new ones, but that's another story).
If you're on v2.2.2, the latest released version, chances are your problem is fixed in the never-released v3.0. To access it, you'll have to build from source.
If you're on v3, please submit an issue, but beware that I might not get back to you in a timely manner.

@SkeleBones
Copy link
Author

Same issue on v3.

@SkeleBones
Copy link
Author

Also, I seemed to have formated this Bug Report wrong.

@GitSquared
Copy link
Owner

Also, I seemed to have formated this Bug Report wrong.

It's fine, however as you probably guessed if you looked over at #769 i might not get back to you anytime soon, sorry. Off the top of my head i can't figure out what's happening here.

@SkeleBones
Copy link
Author

Yeah, it is fine. I can just use the stock shell for now.

@AkechiShiro
Copy link

Does the stock shell work ? I could try to install the Powershell preview 7 on my distro and give it a try to see if I can reproduce your issue.

@SkeleBones
Copy link
Author

SkeleBones commented Oct 27, 2020

Yeah, stock works until I change it then I have to delete settings.json to fix it. I am not able to change it back.

@SkeleBones
Copy link
Author

Didn't mean to do that.

@SkeleBones
Copy link
Author

Semi Log

(node:13784) UnhandledPromiseRejectionWarning: Error: File not found: C:\Program
at new WindowsPtyAgent (C:\edex-ui\src\node_modules\node-pty\lib\windowsPtyAgent.js:74:36)
at new WindowsTerminal (C:\edex-ui\src\node_modules\node-pty\lib\windowsTerminal.js:49:24)
at Object.spawn (C:\edex-ui\src\node_modules\node-pty\lib\index.js:28:12)
at new Terminal (C:\edex-ui\src\classes\terminal.class.js:404:33)
at App. (C:\edex-ui\src_boot.js:234:11)
(node:13784) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13784) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Repository owner deleted a comment from Jr7000750 Oct 28, 2020
@bleek42
Copy link

bleek42 commented Nov 2, 2020

Just wanted to chime in and say @SkeleBones is not alone. I just discovered eDEX-UI today and having problems changing the default shell. Using Windows 10 and trying to change settings.json from the default Powershell to Bash.

@GitSquared
Copy link
Owner

Possibly related: #740 #698

Repository owner deleted a comment from Jr7000750 Nov 2, 2020
@SkeleBones
Copy link
Author

SkeleBones commented Nov 2, 2020

I tried what it said in #698, it didn't work. I'll have to check #740.

@rozbrajaczpoziomow
Copy link

rozbrajaczpoziomow commented Nov 2, 2020

I think I know what's going on,

(node:13784) UnhandledPromiseRejectionWarning: Error: File not found: C:\Program [...]

I think when you're trying to call powershell, you're trying to do smth like this:
start C:\Program Files...
But its not quoted... And then windows thinks (I think it thinks that way) like "C:\Program" is the path and "Files..." is the argument.

Screenshot

@bleek42
Copy link

bleek42 commented Nov 2, 2020

I think I know what's going on,

(node:13784) UnhandledPromiseRejectionWarning: Error: File not found: C:\Program [...]

I think when you're trying to call powershell, you're trying to do smth like this:
start C:\Program Files...
But its not quoted... And then windows thinks (I think it thinks that way) like "C:\Program" is the path and "Files..." is the argument.

Screenshot

soooo in settings.json, right.... in the default terminal, where it now just says powershell.exe, instead of changing it to simply bash.exe, I change it to the entire path where bash.exe is actually located..? still get the same problem. I save these new settings and restart eDEX, and the program just does not start.

@rozbrajaczpoziomow
Copy link

rozbrajaczpoziomow commented Nov 3, 2020

I think I know what's going on,

(node:13784) UnhandledPromiseRejectionWarning: Error: File not found: C:\Program [...]

I think when you're trying to call powershell, you're trying to do smth like this:
start C:\Program Files...
But its not quoted... And then windows thinks (I think it thinks that way) like "C:\Program" is the path and "Files..." is the argument.
Screenshot

soooo in settings.json, right.... in the default terminal, where it now just says powershell.exe, instead of changing it to simply bash.exe, I change it to the entire path where bash.exe is actually located..? still get the same problem. I save these new settings and restart eDEX, and the program just does not start.

I don't think it's an issue with your settings.json file, but propably how the TTY is started? Not really sure, because I don't know how it's handled, but maybe I'll try to look into the source code and figure it out.

Edit: so I looked at:
src/_boot.js:236
src/classes/terminal.class.js:404

It seems like it splits the path to TTY to spaces and then takes the first element of it, so there should be no problems with arguments, but idk how xTerm in Electron works, so im kinda lost, but this also may have been fixed because of (another issue I read but i don't remember the # of it) on the unreleased 3.0 version.

@Animus-Surge
Copy link
Contributor

I’ll have a look. Seems like reading paths from the settings.json messed up if there’s any spaces in it.

@Animus-Surge
Copy link
Contributor

It seems like it splits the path to TTY to spaces and then takes the first element of it, so there should be no problems with arguments, but idk how xTerm in Electron works, so im kinda lost, but this also may have been fixed because of (another issue I read but i don't remember the # of it) on the unreleased 3.0 version.

Yes, this is exactly what's going on. I wonder if instead of having the shell parameters in the same line you have it as a separate key in the settings.json file.

@rozbrajaczpoziomow
Copy link

And also, now I figured out why full paths to like C:\Program Files... don't work... It's literally trying to start C:\Program.. ("C:\Program Files\test".split(" ")[0] == "C:\Program")

@GitSquared
Copy link
Owner

It's literally trying to start C:\Program.. ("C:\Program Files\test".split(" ")[0] == "C:\Program")

Oh that totally makes sense! I've got an idea for a fix, hang on :)

@GitSquared
Copy link
Owner

Could you try this out?

@Animus-Surge
Copy link
Contributor

Animus-Surge commented Nov 17, 2020

Could you try this out?

It worked on my end, at least it feels like it. I set the emulator to nodejs (stored in the program files folder) and it ran without any issues, compared to before the commit where it gave an UnhandledPromiseRejectionError

@lebarde lebarde mentioned this issue Nov 25, 2020
18 tasks
eugene2candy pushed a commit to eugene2candy/edex-ui that referenced this issue Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants