Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Terminal Support #2877

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open

Conversation

daxgames
Copy link
Member

@daxgames daxgames commented Sep 25, 2023

Windows Terminal Support

First looks at Windows Terminal Integration

image

NEED TO FIX

  • Command line help is for ConEmu only and needs to be updated.
  • Probably more.

NEED TO ADD:

  • Nothing that I know of.
  • Maybe more.

Progress So Far:

Cmder.exe Launcher:

  • Runs %cmder_root%\vendor\windows-terminal\WindowsTerminal.exe instead of ConEmu if %cmder_root%\vendor\windows-terminal exists.
  • Supports all existing command line arguments but /title, and /single.
  • Pass ALL arguments following -- argument directly to WindowsTerminal.exe to use the full power of Windows Terminal from the command line.
  • Modified Cmder.bat to launch windows terminal by default if it exists and put the default config file where it needs to be before launching Windows Terminal

Scripts:

  • Added an argument to build.ps1 that allows building with Windows terminal instead of Conemu.

Config:

  • Created a '%cmder_root%\vendor\WindowsTerminal_settings_default.json' that results in the WindowsTerminal Session and profiles shown above. NOTE: Non-Cmder sessions are auto-generated by Windows Terminal.
    • All sessions work as they do today in Cmder using Conemu.
  • Changes to the word separator settings so it works more m=like we would expect it ti work.
  • Added Windows Terminal to %cmder_root%\vendor\sources.json

@daxgames
Copy link
Member Author

I identified an error with Windows terminal support and profiles set to run as Administrator. The %CMDER_ROOT% env var is not set and we have no way of figuring out what the root path for Cmder is on Administrative profiles.

I have requested a feature in Windows Terminal microsoft/terminal#16295 that has the potential to resolve this the same way ConEmu does. Our init scripts could then look for %WT_FOLDER_PATH% the same way we do for %ConEmuDir%

@MartiUK
Copy link
Member

MartiUK commented Nov 15, 2023

I identified an error with Windows terminal support and profiles set to run as Administrator. The %CMDER_ROOT% env var is not set and we have no way of figuring out what the root path for Cmder is on Administrative profiles.

I have requested a feature in Windows Terminal microsoft/terminal#16295 that has the potential to resolve this the same way ConEmu does. Our init scripts could then look for %WT_FOLDER_PATH% the same way we do for %ConEmuDir%

Looks like it's slated for the WT 1.20 release, are you happy to wait or shall we try and find another solution?

@daxgames
Copy link
Member Author

We can wait

@daxgames
Copy link
Member Author

For those that want admin profiles before then you can set CMDER_ROOT globally via Windows env vars to fix the issue.

Cmder.bat Outdated Show resolved Hide resolved
@@ -55,13 +55,16 @@ Param(

# Using this option will skip all downloads, if you only need to build launcher
[switch]$noVendor,

# Using this option will specify the emulator to use [all, conemu-maximus5, or windows-terminal]
[string]$emulator = 'all',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daxgames Would $terminal be a more claritive name to use for this switch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to Terminal

scripts/build.ps1 Outdated Show resolved Hide resolved
Comment on lines 159 to 160
move-item -ErrorAction SilentlyContinue $windowTerminalFiles\* $s.name >$null
remove-item -ErrorAction SilentlyContinue $windowTerminalFiles >$null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please correct the indentation for these two lines? (Tab/Space mismatch) Sorry for the nitpicking

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

scripts/pack.ps1 Outdated Show resolved Hide resolved
@DRSDavidSoft
Copy link
Contributor

@daxgames I've merged this and the speed optimization PRs into development branch for testing purposes.
So sorry it's taking this long to review, I'm still unimaginably busy with some projects and IRL issues, but I'm super eager to test these great additions and apply them in master soon.
Hoping for a speedy Cmder 1.4 release!

@daxgames
Copy link
Member Author

@DRSDavidSoft We can't really release 1.4 until microsoft/terminal#16295 gets released.

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

Successfully merging this pull request may close these issues.

None yet

4 participants