Created attachment 179307 [details] A Screenshot of KWrite `24.12.3-1.fc41.x86_64`'s Tabs for Comment 0. SUMMARY ------- When I invoke `systemctl --user edit plasma-powerdevil.service` with `$Env:EDITOR` set to `$(command -v kwrite)`, the expected (`.conf`) content opens in another, empty tab labelled “+4” appears too: [^1] [1]: https://discuss-cdn.kde.org/uploads/default/original/3X/8/b/8bbddb728e4ec2c00b134f8b4132d691cd83c56e.png Additionally, the name of the tab does not correspond to the relevant `.conf` file's filename. STEPS TO REPRODUCE ------------------ ~~~bash #!/usr/bin/env bash EDITOR="$(command -v kwrite)" && \ # `/usr/bin/kwrite` systemctl --user edit plasma-powerdevil.service ~~~ EXPECTED RESULT --------------- I should see solely one tab, and its name should correspond to the filename in the CLI. SOFTWARE/OS VERSIONS -------------------- I'm using `kwrite-24.12.3-1.fc41.x86_64`. Regarding the OS & DE: 1. ~~~YAML #!/usr/bin/env sh kinfo ~~~ 2. > ~~~YAML > 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: Wayland > Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor > Memory: 30.4 GiB of RAM > Graphics Processor 1: AMD Radeon RX 5700 > Graphics Processor 2: AMD Radeon Graphics > ~~~ ADDITIONAL INFORMATION ---------------------- [^1]: [`discuss-cdn.kde.org/uploads/default/original/3X/8/b/8bbddb728e4ec2c00b134f8b4132d691cd83c56e.png`][1]
> comment #0 I forgot to add the damned most important part - the cause. As [`discuss.kde.org/t/25134/15`][1] states: > Yea, that a `systemctl` optimization 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 - `mcedit` supports > both the `+` syntax and the `:` syntax, so maybe Kate can be convinced to also support both. [1]: https://discuss.kde.org/t/disable-kde-monitor-brightness-control/25134/15?u=rokejulianlockhart
The presented file name being some kind of auto-generated temporary file (e.g. `.../.#override.conf13545878` or some such) is fine - this is `systemctl` generating a temporary file where it can add all the extra comments. Other editors also show the same behavior, and it is not a bug. The feature request here is for Kate/kwrite to support the CLI options "+{line-number} {filename}" to open {filename} at line {line-number}, in addition to the current support of "{filename}:{linenumber}", as it appears that some system tools use that syntax successfully with Nano and other command line editors.
(In reply to Oded Arbel from comment #2) > The feature request here is for Kate/kwrite to support the CLI options "+{line-number} {filename}" to open {filename} at line {line-number}, in addition to the current support of "{filename}:{linenumber}", as it appears that some system tools use that syntax successfully with Nano and other command line editors. I'll probably have to refile this due to https://bugs.kde.org/show_bug.cgi?id=501354#c4, so I'll combine that with it when I do.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1753
Git commit 47ff616f309d392fcde7524eb5e70413f41f45d2 by Waqar Ahmed, on behalf of Christoph Cullmann. Committed on 17/03/2025 at 07:28. Pushed by waqar into branch 'master'. support +xyz line number as first argument CHANGELOG: Kate/KWrite supports 'kate +123 test.txt' to jump to the given line M +22 -7 apps/kate/main.cpp M +10 -8 apps/lib/kateapp.cpp M +23 -0 apps/lib/urlinfo.h https://invent.kde.org/utilities/kate/-/commit/47ff616f309d392fcde7524eb5e70413f41f45d2
(In reply to Waqar Ahmed from comment #5) Thank you!