[Enhancement] When `(Get-Command code).Path` is set as the value of `$Env:EDITOR`, it doesn't support `systemctl edit`.
Does this issue occur when all extensions are disabled?
Yes
VS Code Version
Version: 1.98.2 Commit: ddc367ed5c8936efe395cffeec279b04ffd7db78 Date: 2025-03-12T13:32:45.399Z Electron: 34.2.0 ElectronBuildId: 11161602 Chromium: 132.0.6834.196 Node.js: 20.18.2 V8: 13.2.152.36-electron.0 OS: Linux x64 6.13.7-200.fc41.x86_64
It's code-1.98.0-1741124844.el8.x86_64:
-
#!/usr/bin/env sh dnf5 info code --refresh -
Name : code Epoch : 0 Version : 1.98.0 Release : 1741124844.el8 Architecture : x86_64 Installed size : 400.0 MiB Source : code-1.98.0-1741124844.el8.src.rpm From repository : code
OS Version
-
#!/usr/bin/env pwsh #Requires -PSEdition Core Get-Content -LiteralPath /etc/os-release | Select-String -SimpleMatch CPE_NAME -
CPE_NAME="cpe:/o:fedoraproject:fedora:41"
Steps to Reproduce
-
Configure the OS to match my
kinfooutput (which should be the default state of the KDE Spin):Operating System: Fedora Linux 41 KDE Plasma Version: 6.3.2 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 Kernel Version: 6.13.5-200.fc41.x86_64 (64-bit) Graphics Platform: WaylandThis solely impacts whether
plasma-powerdevil.serviceexists, because it's the example that I've chosen: -
#!/usr/bin/env pwsh #Requires -PSEdition Core EDITOR="$((Get-Command code).Path)" && ` # `/usr/bin/code` systemctl --user edit plasma-powerdevil.service
Result
discuss.kde.org/t/25134/13 compares it to KDE's KWrite, which ultimately supports the application (albeit not in a 100%-perfect state, but that's irrelevant in this context):
Although the file opens in
kwrite-24.12.3-1.fc41.x86_64, another, empty tab labelled "+4" appears too:
#!/usr/bin/env pwsh #Requires -PSEdition Core EDITOR="$((Get-Command kwrite).Path)" && ` # `/usr/bin/kwrite` systemctl --user edit plasma-powerdevil.service
Even more interestingly, closing the filled tab closes the other simultaneously! This doesn't occur if the opposite tab is closed first.
Multiple tabs also appear in
code-1.98.0-1741124844.el8.x86_64, but the other file is empty:
#!/usr/bin/env pwsh #Requires -PSEdition Core EDITOR="$((Get-Command code).Path)" && ` # `/usr/bin/code` systemctl --user edit plasma-powerdevil.service
This doesn't close one tab when the other does, and
systemctlerroneously considers the file to have been "installed" (saved?) the moment that thecodeprocess is spawned.
Cause
A response states the undermentioned: ^2
Yea, that a
systemctloptimization for Nano that prepends+{line-numer}to the file name to get the editor to start at the specified line. The Kate-ism for this is to postfix the line number to the filename with a colon (i.e.{filename}:{line-number}), but my favorite terminal text editor -mceditsupports both the+syntax and the:syntax, so maybe Kate can be convinced to also support both.
This applies to VS Code, too.