From 8a263b7efa0929f1a174a230a710fc757245a1d8 Mon Sep 17 00:00:00 2001 From: Prashanth <30420973+PrashanthCorp@users.noreply.github.com> Date: Tue, 13 Nov 2018 16:30:41 -0800 Subject: [PATCH] Change default bash command for attaching the shell in Linux container. Fixes #518 (#622) --- commands/open-shell-container.ts | 5 ++--- package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/commands/open-shell-container.ts b/commands/open-shell-container.ts index 6688ff0efb..7a946c716f 100644 --- a/commands/open-shell-container.ts +++ b/commands/open-shell-container.ts @@ -8,7 +8,6 @@ import { IActionContext } from 'vscode-azureextensionui'; import { ContainerNode } from '../explorer/models/containerNode'; import { RootNode } from '../explorer/models/rootNode'; import { ext } from '../extensionVariables'; -import { reporter } from '../telemetry/telemetry'; import { docker, DockerEngineType } from './utils/docker-endpoint'; import { ContainerItem, quickPickContainer } from './utils/quick-pick-container'; const teleCmdId: string = 'vscode-docker.container.open-shell'; @@ -17,9 +16,9 @@ function getEngineTypeShellCommands(engineType: DockerEngineType): string { const configOptions: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('docker'); switch (engineType) { case DockerEngineType.Linux: - return configOptions.get('attachShellCommand.linuxContainer', '/bin/sh'); + return configOptions.get('attachShellCommand.linuxContainer'); case DockerEngineType.Windows: - return configOptions.get('attachShellCommand.windowsContainer', 'powershell'); + return configOptions.get('attachShellCommand.windowsContainer'); default: throw new Error(`Unexpected engine type ${engineType}`); } diff --git a/package.json b/package.json index ea2d1157e2..01070fc27f 100644 --- a/package.json +++ b/package.json @@ -556,7 +556,7 @@ }, "docker.attachShellCommand.linuxContainer": { "type": "string", - "default": "/bin/bash", + "default": "/bin/sh -c \"[ -e /bin/bash ] && /bin/bash || /bin/sh\"", "description": "Attach command to use for Linux containers" }, "docker.attachShellCommand.windowsContainer": {