Please add line numbers. #21918

Closed
opened 2026-01-31 07:58:21 +00:00 by claunia · 3 comments
Owner

Originally created by @RokeJulianLockhart on GitHub (Jun 30, 2024).

Description of the new feature/enhancement

As bugs.kde.org/show_bug.cgi?id=485923 describes:

STEPS TO REPRODUCE

Invoke Konsole, and use a command like cat or github.com/MicrosoftDocs/PowerShell-Docs/blob/04dac6ae6b2abcb91006b6a515cc26c72219ffd5/reference/7.4/Microsoft.PowerShell.Management/Get-Content.md#example-2-limit-the-number-of-lines-get-content-returns to output the content of a file to the terminal.

OBSERVED RESULT

Without using cat's -b or -n flags, the content cannot be numbered. For others, like the aforecited Get-Content, it's impossible to output line numbers without writing code for every interaction to iterate over the lines.

Konsole has since gained the ability to display line numbers, as discuss.kde.org/t/14435#always-3 depicts:

Image

It's been invaluable for me, when reading long logs via the terminal. Consequently, I propose the same for Windows Terminal.

Proposed technical implementation details (optional)

I'd rather that they be in a permanent separator following the text direction, or on the opposite of the text direction, still separated regardless (to prevent overlap). Specifically, as bugs.kde.org/show_bug.cgi?id=485970#c3 describes:

I want it to be like a Konsole/Dolphin panel, so that it can be moved to the left or right. However, I'd like it to work like a plasmoid on a PlasmaShell panel does - when a new session is invoked (like when a new tab or window is created) it should be static, and not overlay, like any other panel does. However, I should be able to set a toggle (like PlasmaShell's pin feature) and have it then able to temporarily resize over the session until I pin it again, where it returns to its original size. It should also have a horizontal scrollbar for when the user accidentally sets it shorter than they need at the start of a session.

Does that make sense?

I expected that this implementation wouldn't be possible due to wt's apparent lack of comparable "panel" support, but https://github.com/microsoft/terminal/issues/997#issue-448313575 demonstrates otherwise.

Relevant Notes

PR that added it to Konsole

invent.kde.org/utilities/konsole/-/merge_requests/730

PR that added documentation

invent.kde.org/utilities/konsole/-/merge_requests/988

Originally created by @RokeJulianLockhart on GitHub (Jun 30, 2024). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. [x] If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. [x] If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. [x] If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. [x] If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. [x] If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # **Description of the new feature/enhancement** <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> As [`bugs.kde.org/show_bug.cgi?id=485923`](https://bugs.kde.org/show_bug.cgi?id=485923#c0) describes: <blockQuote> #### **STEPS TO REPRODUCE** Invoke Konsole, and use a command like [`cat`](https://github.com/coreutils/coreutils/blob/225cb8d7473eadb481a4884e929bf23589d4bd82/src/cat.c#L1) or [`github.com/MicrosoftDocs/PowerShell-Docs/blob/04dac6ae6b2abcb91006b6a515cc26c72219ffd5/reference/7.4/Microsoft.PowerShell.Management/Get-Content.md#example-2-limit-the-number-of-lines-get-content-returns`](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/04dac6ae6b2abcb91006b6a515cc26c72219ffd5/reference/7.4/Microsoft.PowerShell.Management/Get-Content.md#example-2-limit-the-number-of-lines-get-content-returns) to output the content of a file to the terminal. #### **OBSERVED RESULT** Without using `cat`'s `-b` or `-n` flags, the content cannot be numbered. For others, like the aforecited `Get-Content`, it's impossible to output line numbers without writing code for every interaction to iterate over the lines. </blockQuote> Konsole has since gained the ability to display line numbers, as [`discuss.kde.org/t/14435#always-3`](https://discuss.kde.org/t/how-to-enable-line-numbers-in-konsole/14435?u=rokejulianlockhart#always-3) depicts: > ![Image](https://github.com/user-attachments/assets/6da2e90c-b02e-40f3-af88-21ee3c89c139) It's been invaluable for me, when reading long logs via the terminal. Consequently, I propose the same for Windows Terminal. # **Proposed technical implementation details (optional)** <!-- A clear and concise description of what you want to happen. --> I'd rather that they be in a permanent separator following the text direction, or on the opposite of the text direction, still separated regardless (to prevent overlap). Specifically, as [`bugs.kde.org/show_bug.cgi?id=485970#c3`](https://bugs.kde.org/show_bug.cgi?id=485970#c3) describes: <blockQuote> I want it to be like a Konsole/Dolphin panel, so that it can be moved to the left or right. However, I'd like it to work like a plasmoid on a *PlasmaShell* panel does - when a new session is invoked (like when a new tab or window is created) it should be static, and not overlay, like any other panel does. However, I should be able to set a toggle (like PlasmaShell's pin feature) and have it then able to temporarily resize over the session until I pin it again, where it returns to its original size. It should also have a horizontal scrollbar for when the user accidentally sets it shorter than they need at the start of a session. Does that make sense? </blockQuote> I expected that this implementation wouldn't be possible due to `wt`'s apparent lack of comparable "panel" support, but https://github.com/microsoft/terminal/issues/997#issue-448313575 demonstrates otherwise. #### Relevant Notes <table> <tbody> <tr> <th> PR that added it to Konsole </th> <td> [`invent.kde.org/utilities/konsole/-/merge_requests/730`](https://invent.kde.org/utilities/konsole/-/merge_requests/730) </td> </tr> <tr> <th> PR that added documentation </th> <td> [`invent.kde.org/utilities/konsole/-/merge_requests/988`](https://invent.kde.org/utilities/konsole/-/merge_requests/988) </td> </tbody> </table>
Author
Owner

@zadjii-msft commented on GitHub (Jul 17, 2024):

Why is less -N (or similar) insufficient for this/?

@zadjii-msft commented on GitHub (Jul 17, 2024): Why is `less -N` (or similar) insufficient for this/?
Author
Owner

@RokeJulianLockhart commented on GitHub (Jul 18, 2024):

https://github.com/microsoft/terminal/issues/17490#issuecomment-2234379836

@zadjii-msft, because that's solely usable when piping command output. It doesn't operate retroactively. Additionally, if I run Get-ChildItem -LiteralPath "$HOME", I see coloured highlights for certain directories, whereas if I invoke Get-ChildItem -LiteralPath "$HOME" | less -N on Fedora 40, I don't (so it breaks command output).

@RokeJulianLockhart commented on GitHub (Jul 18, 2024): > https://github.com/microsoft/terminal/issues/17490#issuecomment-2234379836 @zadjii-msft, because that's solely usable when piping command output. It doesn't operate retroactively. Additionally, if I run `Get-ChildItem -LiteralPath "$HOME"`, I see coloured highlights for certain directories, whereas if I invoke `Get-ChildItem -LiteralPath "$HOME" | less -N` on Fedora 40, I don't (so it breaks command output).
Author
Owner

@DHowett commented on GitHub (Jan 13, 2025):

Hey there! We found this while going back over our Attention backlog.

We don't currently have the architectural support for this (considering that the terminal's scrollback buffer somewhat dates back to the original Console one), and we're not likely to change that any time soon. Given that, I'm gonna close this request out. Thanks for writing it up, and giving all the grounding materials for it. We'll still keep it in mind for the future! 🙂

@DHowett commented on GitHub (Jan 13, 2025): Hey there! We found this while going back over our Attention backlog. We don't currently have the architectural support for this (considering that the terminal's scrollback buffer _somewhat_ dates back to the original Console one), and we're not likely to change that any time soon. Given that, I'm gonna close this request out. Thanks for writing it up, and giving all the grounding materials for it. We'll still keep it in mind for the future! 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21918