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

macOS: the current working directory is /, rather than the user's home directory #108

Closed
dyaandys opened this issue Mar 2, 2017 · 4 comments
Labels

Comments

@dyaandys
Copy link
Contributor

dyaandys commented Mar 2, 2017

Start APL/RIDE on macOS
)SH pwd
/

IDE:
Version: 4.0.2679
Platform: MacIntel
Date: 2017-03-01 19:10:37 +0000
Git commit: c359f66
Preferences:{

}

Interpreter:
Version: 16.0.29355
Platform: Mac-64
Edition: Unicode/64
Date: Mar 2 2017 at 02:32:24

@jayfoad jayfoad added the MacOS label Mar 2, 2017
@jayfoad
Copy link
Contributor

jayfoad commented Mar 3, 2017

Jay's diagnosis:

  1. On the Mac, when you click on an application like RIDE, the system seems to start it with / as the current working directory (cwd).
  2. When RIDE spawns an interpreter, the new process inherits the cwd of its parent.

Possible solutions:

  1. Get RIDE to change its own cwd to $HOME as it starts up.
  2. Get RIDE to set the cwd of any interpreter it spawns to $HOME.

But neither of these feel quite right to me, because if I start RIDE from the command line (e.g. on Linux) and spawn an interpreter, I might reasonably expect that the spawned interpreter is running in the same directory that I started RIDE from.

So, I propose to add a new "working directory" option when you spawn an interpreter. The field will be prefilled with the value of $HOME, but you can set it to anything you like, including "" (empty) to inherit RIDE's own cwd.

@JasonRivers
Copy link
Member

This sounds like a good solution.

In the UI, Please could you expand $HOME, though. As a user - I might have no idea what $HOME means, but I know exactly what /Users/Jason (macOS) or /home/jason (Linux) is.

@jayfoad jayfoad closed this as completed in f40696e Mar 3, 2017
@jayfoad
Copy link
Contributor

jayfoad commented Mar 6, 2017

There's still a problem: when you start RIDE with RIDE_SPAWN=dyalog, you don't get a chance to set the working directory, so it still defaults to / on the Mac.

@jayfoad jayfoad reopened this Mar 6, 2017
@jayfoad
Copy link
Contributor

jayfoad commented Mar 16, 2017

The intent of those commits is:

  1. For developers, if you run RIDE from the command line, and RIDE spawns an interpreter, the interpreter will be running in whatever your current directory was in the first place.

  2. If you run an installed RIDE it'll be running in your home directory (at least on the Mac; not sure about other platforms yet) so any spawned interpreter will also run in your home directory.

  3. In both cases you can override the working directory of the interpreter by filling in a field on the connect page, giving an absolute or relative path. The field defaults to '' (empty string) which just means wherever RIDE is running.

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

No branches or pull requests

3 participants