https://bugs.kde.org/show_bug.cgi?id=491419

            Bug ID: 491419
           Summary: Terminal plugin should offer a choice of shell and
                    more modern defaults
    Classification: Applications
           Product: kate
           Version: 24.07.80
          Platform: Microsoft Windows
                OS: Microsoft Windows
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: ad...@petermello.net
  Target Milestone: ---

SUMMARY
In using Kate on Windows I've found the restriction to using Windows PowerShell
as the only available shell to be a significant pain point. I'm advocating for
an additional configuration variable to hold the path to the user's preferred
shell interpreter and the inclusion of PowerShell 6+ to the lookup patterns for
Windows shells, preceding Windows PowerShell in that list.

STEPS TO REPRODUCE
1. Open Kate on Windows, and from the Configure Kate… modal, enable the
Terminal plugin.
2. Click the button on the toolbar to expand the Terminal pane.

OBSERVED RESULT
Windows PowerShell (powershell.exe) is always loaded, with no recourse to
invoke another interpreter except to daisy chain them by invoking one from
within the other.

EXPECTED RESULT
Ideally, Kate would check the $PATH environment variable for a list of shells
in descending order of preference, and for those preferences to rank PowerShell
6/7+ (formerly PowerShell Core) ahead of Windows PowerShell, despite the former
not being present on all Windows environments.

SOFTWARE/OS VERSIONS
Windows 11 Pro, Version 24H2 (Build 26120.1340)
Kate 24.07.70

ADDITIONAL INFORMATION
I went looking through the source repository for where the shell invocation was
made, but due to the extraordinary modularity of the codebase, I was completely
unable to find it, and at the end was no longer sure I was even looking in the
correct repository. Whether or not the suggestion to expose the choice of shell
to the user in the application configuration is accepted, this should
reasonable take the form of an array of values being attempted when opening a
shell in lieu of a single, static value. When Microsoft transitioned PowerShell
into an open-source project built on .NET, the filename of the interpreter was
changed from powershell.exe to pwsh.exe.[0] My desire is for Kate to first
attempt to call pwsh.exe when a terminal pane is activated, and only use
powershell.exe as a fallback.

It seems logical to me that the Kate userbase, by its nature being
self-selected as a group disposed to use a text editor chiefly built for Linux
in a Windows environment, would have a large positive correlation with those
who would also take the time to install the newer, cross-platform iteration of
PowerShell rather than the closed-source, Windows-only variety that comes
packaged with Windows. (This well describes my own motivations, for though
PowerShell is far from my favorite shell or language to work with, I have been
pleasantly surprised by the frequency of instances in which I find a need to
open a PowerShell tab in Yakuake while using Linux in order to test a script or
work out a process I'm attempting to document for others.) The frustration I
currently experience with Kate's terminal stems largely from the fact that in
using the Windows PowerShell (v5.1) flavor, it calls all of my standard
PowerShell startup files but is incompatible with all of the modules and ~50%
of the commands contained therein, leading to a buffer full of error messages
and none of the conveniences I'm accustomed to, all before I've begun anything.

If it can be straightforwardly explained to me where this/these modification(s)
to the codebase need to be made and the manner in which they'd be acceptable,
I'd be more than happy to formulate the MR personally; I've always been treated
with the utmost courtesy and understanding when I've contributed to KDE
projects in the past and have long felt that I should try to do so more often.

[0]:
https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.4#powershell-executable-changes

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to