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 preset, 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

eclipse-platform-bot commented Sep 15, 2026 •

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 960451bc6205415313cc33d1b302b65912373b7d Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Sat, 3 Oct 2026 08:39:51 +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

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   53m 48s ⏱️ - 2m 51s
 4 849 tests ±0   4 827 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 438 runs  ±0  12 284 ✅ ±0  154 💤 ±0  0 ❌ ±0 

Results for commit fe60f9b. ± Comparison against base commit 8fa7d88.

♻️ This comment has been updated with latest results.

@danthe1st
danthe1st force-pushed the terminal-windows-default-shell branch from 14df6bd to 0cd6d72 Compare October 2, 2026 20:35
@danthe1st

danthe1st commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

@vogella Since you asked me to create this PR, is there anything else we should do?
(I only rebased it now)

@vogella
vogella self-requested a review October 2, 2026 22:20
@vogella

vogella commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@vogella Since you asked me to create this PR, is there anything else we should do? (I only rebased it now)

I review next weeek, ping me if I forget. Check, if possible the build error in betweeen and try to fix.

@danthe1st

danthe1st commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

I review next weeek, ping me if I forget. Check, if possible the build error in betweeen and try to fix.

Looking at https://github.com/eclipse-platform/eclipse.platform/runs/111035168999, it's 503 errors from GitHub (unless something else happened in Jenkins which I don't have the permission to see). I'll do another force push to trigger a rebuild.

@danthe1st
danthe1st force-pushed the terminal-windows-default-shell branch from 39a283e to 529c68f Compare October 3, 2026 08:36
@danthe1st

Copy link
Copy Markdown
Contributor Author

@vogella Here's your reminder ping (even though it's just the middle of the week).

@vogella

vogella commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@vogella Here's your reminder ping (even though it's just the middle of the week).

Thanks

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

Labels

None yet

Projects

None yet

3 participants