Fix #2669 & #2396 - Failure to start Neovim on OSX 10.14 Mojave (#2682)

* Set 'LANG' environment variable on Mac if not set to workaround crash

* Fix lint
This commit is contained in:
Bryan Phelps 2018-12-14 18:10:49 -08:00 committed by GitHub
parent 3c1ef98f4e
commit 6128e77ced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -155,14 +155,28 @@ export class Process implements Oni.Process {
existingPath = process.env.Path || process.env.PATH
}
const additionalEnvironmentVariables =
configuration.getValue("environment.additionalVariables") || {}
const requiredOptions = {
env: {
...process.env,
...this._env,
...originalSpawnOptions.env,
...additionalEnvironmentVariables,
},
}
// TODO: Workaround for the bug fix here:
// https://github.com/neovim/neovim/pull/9345
// Once 0.3.2 is available and we've switched, we won't need this anymore.
if (Platform.isMac() && !requiredOptions.env.LANG) {
requiredOptions.env.LANG = "en_us.UTF-8"
Log.warn(
"'LANG' environment variable not set, using default value of 'en_us.UTF-8'. Consider setting environment.additionalVariables['LANG'].",
)
}
requiredOptions.env.PATH = this.mergePathEnvironmentVariable(
existingPath,
configuration.getValue("environment.additionalPaths"),

View File

@ -176,6 +176,7 @@ const BaseConfiguration: IConfigurationValues = {
"explorer.maxUndoFileSizeInBytes": 500_000,
"environment.additionalPaths": [],
"environment.additionalVariables": {},
"keyDisplayer.showInInsertMode": false,

View File

@ -214,6 +214,9 @@ export interface IConfigurationValues {
// (and available in terminal integration, later)
"environment.additionalPaths": string[]
// Additional environment variables that override the default settings
"environment.additionalVariables": any
// User configurable array of files for which
// the image layer opens
"editor.imageLayerExtensions": string[]