Skip to content

allow specifying default local terminal shell on Windows systems - #2932

Open
danthe1st wants to merge 2 commits into
eclipse-platform:masterfrom
danthe1st:terminal-windows-default-shell
Open

danthe1st wants to merge 2 commits into
eclipse-platform:masterfrom
danthe1st:terminal-windows-default-shell

Conversation

@danthe1st

@danthe1st danthe1st commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

This PR allows configuring the default shell on Windows and not just on Linux/macOS.

I mainly just removed some !Platform.OS_WIN32.equals(Platform.getOS()) checks where this is relevant (in createContents(Composite), I extracted that part to a method but I can change that back to make it easier to review).

Note: For updating the Leave the shell command empty to fallback to the SHELL environment variable or if not set, to /bin/sh. message for Windows, I duplicated the following code from the org.eclipse.terminal.connector.local module. Alternatively, I could create public methods in the x-internal package.

		String defaultShellEnvironmentVariable;
		String defaultShellIfNotSet;
		if (Platform.OS_WIN32.equals(Platform.getOS())) {
			defaultShellEnvironmentVariable = "ComSpec"; //$NON-NLS-1$
			defaultShellIfNotSet = "cmd.exe"; //$NON-NLS-1$
		} else {
			defaultShellEnvironmentVariable = "SHELL"; //$NON-NLS-1$
			defaultShellIfNotSet = "/bin/sh"; //$NON-NLS-1$
		}

Note: When I tried to use it with PowerShell, the color mapping wasn't ideal with some of the text being invisible due to having the same color as the background (PowerShell seems to use the "Bright White" and "Bright Yellow" colors). I don't know whether this is something that can/should be changed. With the "Eclipse Light" color present, PowerShell was more readable IMO.

Also, I didn't do an exhaustive test of all related code on Windows but it seems like the default configuration, changing the shell/arguments and restoring the defaults works.
I don't know why it was originally disabled (maybe the coloring issue with PowerShell?).

Fixes #2117

@eclipse-platform-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

terminal/bundles/org.eclipse.terminal.connector.local/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From e4f0af46a80c679aed114fd3d27536bcf50d7d80 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Tue, 15 Sep 2026 17:33:53 +0000
Subject: [PATCH] Version bump(s) for 4.42 stream


diff --git a/terminal/bundles/org.eclipse.terminal.connector.local/META-INF/MANIFEST.MF b/terminal/bundles/org.eclipse.terminal.connector.local/META-INF/MANIFEST.MF
index c1ea0f7371..0367f64b13 100644
--- a/terminal/bundles/org.eclipse.terminal.connector.local/META-INF/MANIFEST.MF
+++ b/terminal/bundles/org.eclipse.terminal.connector.local/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.terminal.connector.local;singleton:=true
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.1.300.qualifier
 Bundle-Activator: org.eclipse.terminal.connector.local.activator.UIPlugin
 Bundle-Vendor: %providerName
 Import-Package: org.eclipse.cdt.utils.pty;mandatory:=native,
-- 
2.55.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   58m 48s ⏱️ -46s
 4 810 tests ±0   4 788 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 321 runs  ±0  12 168 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 14df6bd. ± Comparison against base commit 2d15cf3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants