Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Save and restore the environment for windows - #11337

Closed
joefitzgerald wants to merge 3 commits into
masterfrom
jf-ensure-env-works-when-restoring-windows
Closed

joefitzgerald wants to merge 3 commits into
masterfrom
jf-ensure-env-works-when-restoring-windows

Conversation

@joefitzgerald

Copy link
Copy Markdown
Contributor

This PR more robustly handles the environment in atom-window and the browser window. It:

Note: This fix is recommended for cherry picking into the beta channel once merged, as it fixes issues present in the 1.7.x beta.

/cc @lee-dohm

@joefitzgerald joefitzgerald self-assigned this Apr 1, 2016
@thomasjo thomasjo changed the title Save And Restore The Environment For Windows Save and restore the environment for windows Apr 1, 2016
@joefitzgerald
joefitzgerald force-pushed the jf-ensure-env-works-when-restoring-windows branch from 6c4e4cc to 6a5b68f Compare April 1, 2016 23:10
@lee-dohm

Copy link
Copy Markdown
Contributor

I talked about this with the team this morning and there's some concern that persisting the environment across an exit is the right thing to do. Can you clarify what this is useful for? What if my environment changes between invocations of Atom? Shouldn't Atom always have the most up-to-date environment?

Regarding updating the environment of an already running window from the command line, is this much more useful than changing it via the console in the Developer Tools?

@joefitzgerald

Copy link
Copy Markdown
Contributor Author

What if my environment changes between invocations of Atom?

This logic only kicks in when Atom is launched via Dock / Finder / Spotlight. When it is launched from a terminal, the environment is reset to that of the terminal. I suppose there is an edge case here where a user launches a bare atom from the terminal (i.e. without an initial path); this should cause a reset of the environment too.

The purpose of this part of the PR (there are others) is: suppose you start atom from the terminal. The environment is set very specifically to work for a specific project folder / window. Then you quit atom, and relaunch it (accidentally forgetting to launch from the terminal, and instead launching from the Dock or Spotlight or Finder). Your prior window(s) launch and the environment for each remains the way you intended. You can resume your work without futzing with closing all Atom windows, and launching each one individually from the right terminal window.

Without this change, the environment for the Atom window is broken in many scenarios depending on the flow with which the user launches Atom windows. This presents a cognitive burden to the user who has to grok "how did I launch this last time??" (if they even remember).

Regarding updating the environment of an already running window from the command line, is this much more useful than changing it via the console in the Developer Tools?

Yes, because a user shouldn't have to open the developer tools to update their environment. If the user invokes atom . or atom somedir multiple times, what is the downside of allowing the environment to change? It allows the user to control the environment in their original environment and signal to atom that it has changed by relaunching atom with the changes.

@lee-dohm

Copy link
Copy Markdown
Contributor

Modifying the already open environment is a much easier sell than persisting an environment. Perhaps it should be in its own PR?

- Allows serialization to always work against the most recent environment for the Window
@joefitzgerald
joefitzgerald force-pushed the jf-ensure-env-works-when-restoring-windows branch from 6a5b68f to 34eae59 Compare April 12, 2016 21:14
@joefitzgerald
joefitzgerald deleted the jf-ensure-env-works-when-restoring-windows branch August 31, 2016 06:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent environment and behaviour

2 participants