-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Draw a horizontal line / ruler between commands (read: blocks ) #17493
Comments
You might be interested in the public API: https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/ Alternatively, you can pass raw pipe endpoints (created by pipe-functions) as stdin/stdout/stderr to the process you start by CreateProcessW with specified Some important Win32 Console Subsystem details that you need to know and understand (in chronological order): |
Thank you, I thought I had already learned everything about working with Pipes, ConPTY, and Escape sequences. I'm disappointed that ConPTY does not provide the flexibility I need. I only receive a stream of bytes without any markers, exit codes, or other signals that would help break the results into blocks. So far, for PowerShell, the best idea I have is to create a module and integrate it into the profile, which places custom markers between commands. However, I'm not sure if this approach is good. As for CMD, I have no ideas at all. |
Perhaps this can be implemented using the so-called Shell Integration: https://devblogs.microsoft.com/commandline/shell-integration-in-the-windows-terminal/ But I do not know. how it works from the 3p terminals side. |
Works great! 👍THX
|
Hi, you might want to check out clink, which is an amazing lua-based cmd-overhaul-thing. It has a lot of features like readline command line editing and tons more. |
Alright, lots to unpack here. Looks like there's three main requests, so I'll break those out. A lot of this is stuff we've talked about at length in a variety of threads across the repo, but I'll give you some additional details. As mentioned, almost all this is powered by some form of Shell Integration. The best docs page we have can be found at Shell Integration. The first two by the aforementioned FTCS marks. The third will be powered by a (still very experimental) protocol for sending suggestions to the Terminal from the shell. Dividing results into blocksThis one I don't think we actually have tracked anywhere specifically. I'm hunting it down but I think it doesn't have a dedicated thread. I may promote this thread to be the blocks thread. I know we referenced it in #13445 What we do have today is support for navigating by command, and selecting entire command outputs: https://learn.microsoft.com/en-us/windows/terminal/tutorials/shell-integration#automatically-jump-between-commands The part we're still missing is "a horizontal ruler that separates individual commands when shell integration is enabled". I don't think doing it would be terribly impossible, but there's a lot of weird edge cases for drawing lines in a grid of text1. Commands historyThis is something we're actively improving via the suggestions UI. In 1.22, it looks something like: AutocompleteWe're tracking this in #3121. What we've got today looks like: That's powered by the same suggestions menu that powers command history, above. https://github.com/microsoft/terminal/wiki/Experimental-Shell-Completion-Menu has some notes on how to enable it. Other references:
Footnotes
|
@zadjii-msft It's possible you were thinking of collapsible regions (#13298), which is a similar concept. |
@zadjii-msft, perhaps you can answer a question I have regarding ConPTY? From Shell Integration for PowerShell, I took only a small part to see how it would look and if I could use it (it would solve many problems): function prompt {
$out += "`e]133;A$([char]07)";
$out += "`e]9;9;`"$loc`"$([char]07)";
$out += "PWSH $loc$('>' * ($nestedPromptLevel + 1)) ";
$out += "`e]133;B$([char]07)";
return $out
} Looking at this, I expected to get the prompt from ConPTY in this form:
But in my result,
Is this the correct behavior, or did I miss something? |
@inkwadra I bet that's right, if you're using the in-the-OS version of the ConPTY APIs. Certain VT sequences can arrive out of order with older versions of ConPTY1. The Terminal actually packages a version of the latest conpty directly into our package. It's not impossible to do, but it's certainly not as easy as we'd like to make it. That work is tracked over in #15065, but it's definitely possible to do today. I believe wezterm is already doing something similar. Thanks @j4james for finding that issue. I honestly have no memory of writing that issue up two years ago 😅 The debate I'm mulling over is if we should use this just for "draw a horizontal rule between commands", and leave #13298 for "make the space between rules collapsible". In my head there's some space between those two, so I'm leaning towards leaving this open Footnotes |
Description of the new feature/enhancement
I recently decided to start developing my dream terminal for Windows. However, since I'm not a professional developer and the development will take quite a long time, I thought: "Why let the concepts go to waste?" Perhaps this will be at least somewhat useful for Windows Terminal developers.
Concepts:
P.S.
If anyone can give me a hint on how to theoretically capture process output and divide it into blocks from the output stream of a Windows pseudoconsole, I would be very grateful.
Thank you for your attention.
The text was updated successfully, but these errors were encountered: