From 5ad9398b01877790137c6373e3e5773ca84d9678 Mon Sep 17 00:00:00 2001 From: Nick Wade Date: Thu, 25 Apr 2019 07:57:12 -0700 Subject: [PATCH 1/7] Fix typo DigitalOcean (#595) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8637e46f..dff27fcd 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile) For detailed instructions and troubleshooting, see the [self-hosted quick start guide](doc/self-hosted/index.md). -Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md), [AWS](doc/admin/install/aws.md), and [Digital Ocean](doc/admin/install/digitalocean.md). +Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md), [AWS](doc/admin/install/aws.md), and [DigitalOcean](doc/admin/install/digitalocean.md). How to [secure your setup](/doc/security/ssl.md). From 446573809c686401cf65cb6bd399ba8353c572f0 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 25 Apr 2019 12:05:47 -0500 Subject: [PATCH 2/7] Improve size column in dialogs - Remove size from directories (often always 4K and not very useful). - Format file sizes to be more human-readable. --- packages/vscode/src/dialog.scss | 12 +++++++++--- packages/vscode/src/dialog.ts | 14 +++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/vscode/src/dialog.scss b/packages/vscode/src/dialog.scss index 2d08911f..b1ffb846 100644 --- a/packages/vscode/src/dialog.scss +++ b/packages/vscode/src/dialog.scss @@ -79,9 +79,7 @@ .dialog-entry { cursor: pointer; font-size: 1.02em; - padding: 0px; - padding-left: 8px; - padding-right: 8px; + padding: 0px 8px; .dialog-entry-info { display: flex; @@ -94,6 +92,14 @@ margin-right: 5px; } + .dialog-entry-size { + text-align: right; + } + + .dialog-entry-mtime { + padding-left: 8px; + } + &:hover { background-color: var(--list-hover-background); } diff --git a/packages/vscode/src/dialog.ts b/packages/vscode/src/dialog.ts index 6eb63405..734626cb 100644 --- a/packages/vscode/src/dialog.ts +++ b/packages/vscode/src/dialog.ts @@ -480,7 +480,7 @@ class DialogEntryRenderer implements ITreeRenderer Date: Thu, 25 Apr 2019 13:22:30 -0500 Subject: [PATCH 3/7] Fix toggling full screen --- packages/ide/src/fill/electron.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/ide/src/fill/electron.ts b/packages/ide/src/fill/electron.ts index 1ef1677b..03901ac2 100644 --- a/packages/ide/src/fill/electron.ts +++ b/packages/ide/src/fill/electron.ts @@ -378,14 +378,25 @@ class BrowserWindow extends EventEmitter { public setFullScreen(fullscreen: boolean): void { if (fullscreen) { - document.documentElement.requestFullscreen(); + document.documentElement.requestFullscreen().catch((error) => { + logger.error(error.message); + }); } else { - document.exitFullscreen(); + document.exitFullscreen().catch((error) => { + logger.error(error.message); + }); } } public isFullScreen(): boolean { - return document.fullscreenEnabled; + // TypeScript doesn't recognize this property. + // tslint:disable no-any + if (typeof (window as any)["fullScreen"] !== "undefined") { + return (window as any)["fullScreen"]; + } + + // tslint:enable no-any + return false; } public isFocused(): boolean { From 58cf109a836c0c31baf1da6c37c1311a96f5e6be Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 25 Apr 2019 13:29:11 -0500 Subject: [PATCH 4/7] Fix full screen detection for Chromium --- packages/ide/src/fill/electron.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/ide/src/fill/electron.ts b/packages/ide/src/fill/electron.ts index 03901ac2..dc74d244 100644 --- a/packages/ide/src/fill/electron.ts +++ b/packages/ide/src/fill/electron.ts @@ -394,9 +394,15 @@ class BrowserWindow extends EventEmitter { if (typeof (window as any)["fullScreen"] !== "undefined") { return (window as any)["fullScreen"]; } - // tslint:enable no-any - return false; + + try { + return window.matchMedia("(display-mode: fullscreen)").matches; + } catch (error) { + logger.error(error.message); + + return false; + } } public isFocused(): boolean { From a3ac4567e39133e736e7e74365f10e9b97861621 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 25 Apr 2019 14:08:46 -0500 Subject: [PATCH 5/7] Only output password if it was generated --- packages/server/src/cli.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/cli.ts b/packages/server/src/cli.ts index 7183d45b..26b1adea 100644 --- a/packages/server/src/cli.ts +++ b/packages/server/src/cli.ts @@ -216,6 +216,7 @@ const bold = (text: string | number): string | number => { } let password = options.password || process.env.PASSWORD; + const usingCustomPassword = !!password; if (!password) { // Generate a random password with a length of 24. const buffer = Buffer.alloc(12); @@ -304,7 +305,7 @@ const bold = (text: string | number): string | number => { logger.warn("Documentation on securing your setup: https://github.com/codercom/code-server/blob/master/doc/security/ssl.md"); } - if (!options.noAuth) { + if (!options.noAuth && !usingCustomPassword) { logger.info(" "); logger.info(`Password:\u001B[1m ${password}`); } else { From 4c5bb83fc11b71664783c6abd081ff318663f107 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 25 Apr 2019 15:16:53 -0500 Subject: [PATCH 6/7] Fix open dialog crash when there is a broken link Fixes #579. --- packages/vscode/src/dialog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode/src/dialog.ts b/packages/vscode/src/dialog.ts index 734626cb..4ec06306 100644 --- a/packages/vscode/src/dialog.ts +++ b/packages/vscode/src/dialog.ts @@ -404,7 +404,7 @@ class Dialog { */ private async list(directory: string): Promise> { const paths = (await util.promisify(fs.readdir)(directory)).sort(); - const stats = await Promise.all(paths.map(p => util.promisify(fs.stat)(path.join(directory, p)))); + const stats = await Promise.all(paths.map(p => util.promisify(fs.lstat)(path.join(directory, p)))); return stats.map((stat, index): DialogEntry => ({ fullPath: path.join(directory, paths[index]), From 4e62f938a967eb2e38d944408d28296bf75b9e5a Mon Sep 17 00:00:00 2001 From: John McCambridge Date: Thu, 25 Apr 2019 15:23:03 -0500 Subject: [PATCH 7/7] Remove reveal in finder/explorer option from the context menu (#586) --- packages/vscode/src/fill/menuRegistry.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/vscode/src/fill/menuRegistry.ts b/packages/vscode/src/fill/menuRegistry.ts index f3e7520a..c095f63d 100644 --- a/packages/vscode/src/fill/menuRegistry.ts +++ b/packages/vscode/src/fill/menuRegistry.ts @@ -5,6 +5,7 @@ import { OpenProcessExplorer } from "vs/workbench/contrib/issue/electron-browser import { ToggleDevToolsAction } from "vs/workbench/electron-browser/actions/developerActions"; import { OpenPrivacyStatementUrlAction, OpenRequestFeatureUrlAction, OpenTwitterUrlAction } from "vs/workbench/electron-browser/actions/helpActions"; import { CloseCurrentWindowAction, NewWindowAction, ShowAboutDialogAction } from "vs/workbench/electron-browser/actions/windowActions"; +import { REVEAL_IN_OS_COMMAND_ID } from "vs/workbench/contrib/files/browser/fileCommands"; const toSkip = [ ToggleDevToolsAction.ID, @@ -16,6 +17,7 @@ const toSkip = [ NewWindowAction.ID, CloseCurrentWindowAction.ID, CloseWorkspaceAction.ID, + REVEAL_IN_OS_COMMAND_ID, // Unfortunately referenced as a string "update.showCurrentReleaseNotes",