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

.bash_profile is not loaded on macOS #492

Closed
3 of 10 tasks
jd-lara opened this issue Apr 29, 2019 · 23 comments
Closed
3 of 10 tasks

.bash_profile is not loaded on macOS #492

jd-lara opened this issue Apr 29, 2019 · 23 comments
Assignees
Labels

Comments

@jd-lara
Copy link

jd-lara commented Apr 29, 2019

Technical information

Using version:

  • master (running from GitHub-published source code, currently v2.2.0-pre)
  • latest (latest release, currently v2.2.0)
  • 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

After replacing v0.2.1 with v0.2.2 the interface won't start and when hitting close I get an error

image

@GitSquared
Copy link
Owner

@jd-lara Does any part of the interface loads up or are you faced with a black screen?

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

Nothing loads, just the icon in the bar.

@GitSquared
Copy link
Owner

GitSquared commented Apr 29, 2019

Do you know how to launch the app from a terminal? I'd need to check the stdio output.

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

jdlara@switch-workstn9:/Applications/eDEX-UI.app/Contents/MacOS$ ./eDEX-UI 
▶  start     Starting eDEX-UI v2.2.0
ℹ  info      With Node 10.11.0 and Electron 4.1.4
ℹ  info      Renderer is Chrome 69.0.3497.128
✖  fatal     Error: Another instance of eDEX is already running. Cannot proceed.
jdlara@switch-workstn9:/Applications/eDEX-UI.app/Contents/MacOS$ ./eDEX-UI 
▶  start     Starting eDEX-UI v2.2.0
ℹ  info      With Node 10.11.0 and Electron 4.1.4
ℹ  info      Renderer is Chrome 69.0.3497.128
▶  Startup   Initialized timer...
ℹ  info      Base config dir is /Users/jdlara/Library/Application Support/eDEX-UI
☐  pending   Loading settings file...
✔  success   Settings loaded!
(node:15877) UnhandledPromiseRejectionWarning: Error: spawn bash -l ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:15877) 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: 2)
(node:15877) [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.
GVA info: Successfully connected to the Intel plugin, offline Gen9 

@GitSquared
Copy link
Owner

Great, thanks a lot. This line is interesting:

Error: spawn bash -l ENOENT

I'm assuming your eDEX config is set to use bash? Could you try and point that to the full path?
(most likely /bin/bash, although I'm not sure about the directory structure under macOS)

You can find the config in ~/Library/Application Support/eDEX-UI.

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

Same behavior here is my config file

{
    "shell": "/bin/bash -l",
    "cwd": "/Users/jdlara",
    "env": "/Users/jdlara/.bash_profile",
    "keyboard": "en-US",
    "theme": "tron-notype",
    "termFontSize": 22,
    "audio": false,
    "pingAddr": "1.1.1.1",
    "port": 3000,
    "monitor": 0,
    "nointro": false,
    "iface": "en0",
    "allowWindowed": false,
    "excludeSelfFromToplist": true,
    "hideDotfiles": false,
    "experimentalGlobeFeatures": false,
    "experimentalFeatures": false
}

@GitSquared
Copy link
Owner

GitSquared commented Apr 29, 2019

Could you try and remove the env key in your config? The syntax you're using there is not supported and it might be causing some troubles

(I should probably add support for what you were trying to do with this, by the way. Will look into it later.)

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

I just removed the whole ~/Library/Application Support/eDEX-UI folder and it works now. It seems that the configuration won't load. How can I load my .bash_profile?

@GitSquared
Copy link
Owner

Ok, very good news, it's just a config mishap 😅

Normally, with the changes in this new release, your .bash_profile config should be automatically imported into eDEX without any extra steps.

Is this not working?

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

No, nothing from my .bash_profile is loading. This is my new settings

{
    "shell": "bash",
    "cwd": "/Users/jdlara",
    "keyboard": "en-US",
    "theme": "tron-notype",
    "termFontSize": 22,
    "audio": false,
    "disableFeedbackAudio": false,
    "pingAddr": "1.1.1.1",
    "port": 3000,
    "monitor": 0,
    "nointro": false,
    "nocursor": false,
    "iface": "en0",
    "allowWindowed": false,
    "excludeSelfFromToplist": false,
    "hideDotfiles": false,
    "experimentalGlobeFeatures": false,
    "experimentalFeatures": false
}

@GitSquared
Copy link
Owner

@jd-lara This is not a definitive fix, but setting your shell key in the config to something like bash --login -c 'source ~/.bash_profile' could do the trick.

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

After making the change then the problem of not loading happens again. Even if I set it to bash -l

@GitSquared
Copy link
Owner

Same error in stdio?

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

Yes, same everything. No display and later on to quit I get the error.

@GitSquared
Copy link
Owner

Weird. I'll do some testing myself tomorrow, get a patch release out if there's something to fix.

Could you send me your config with the fix I proposed, just to make sure?

@jd-lara
Copy link
Author

jd-lara commented Apr 29, 2019

Tried these 2 options

{
    "shell": "bash --login -c 'source ~/.bash_profile'",
    "cwd": "/Users/jdlara",
    "keyboard": "en-US",
    "theme": "tron-notype",
    "termFontSize": 22,
    "audio": false,
    "disableFeedbackAudio": false,
    "pingAddr": "1.1.1.1",
    "port": 3000,
    "monitor": 0,
    "nointro": false,
    "nocursor": false,
    "iface": "en0",
    "allowWindowed": false,
    "excludeSelfFromToplist": false,
    "hideDotfiles": false,
    "experimentalGlobeFeatures": false,
    "experimentalFeatures": false
}
{
    "shell": "bash -l",
    "cwd": "/Users/jdlara",
    "keyboard": "en-US",
    "theme": "tron-notype",
    "termFontSize": 22,
    "audio": false,
    "disableFeedbackAudio": false,
    "pingAddr": "1.1.1.1",
    "port": 3000,
    "monitor": 0,
    "nointro": false,
    "nocursor": false,
    "iface": "en0",
    "allowWindowed": false,
    "excludeSelfFromToplist": false,
    "hideDotfiles": false,
    "experimentalGlobeFeatures": false,
    "experimentalFeatures": false
}

@GitSquared
Copy link
Owner

All right. Thanks for the report, will look into it first thing tomorrow.

@GitSquared GitSquared changed the title MacOS version broken .bash_profile is not loaded on macOS Apr 30, 2019
@GitSquared
Copy link
Owner

image

@jd-lara I got automatic env loading to work as expected and fixed the error you were getting. eDEX automatically appends the --login option to the shell command and the correct env is set.

Will release a patch for this, v2.2.1.

@GitSquared
Copy link
Owner

Patch is up. Thanks for your help.

@jd-lara
Copy link
Author

jd-lara commented Apr 30, 2019

Thanks, it works. I have one more question on loading the .bash_profile. I have the following lines in my profile to show my current branch in the terminal

# enables auto completion of git commands
if [ -f $(brew --prefix)/etc/bash_completion ]; then
  source $(brew --prefix)/etc/bash_completion
fi
 
# adds branch status information in the terminal path
source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh
#PS1="\h:\W \u\$(__git_ps1 \" (%s)\")\$ "
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$(__git_ps1 \"(%s)\")\$ "

So, my terminal looks like this

image

But this setting is not being picked up by eDEX

image

@GitSquared
Copy link
Owner

In your second screenshot, it doesn't look like you are in a Git directory...?

@jd-lara
Copy link
Author

jd-lara commented Apr 30, 2019

It was an error in the .bash_profile sorry.

@GitSquared
Copy link
Owner

OK, np.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants