-
Notifications
You must be signed in to change notification settings - Fork 777
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
OSC 133: Support semantic prompt regions #5932
Comments
I think we should separate the shell integration side of this from the core side. I believe the actionable part of this issue is to enhance the core to understand semantic prompt regions, is that correct? |
They'll need to coordinate (i.e. we may need to adjust the sequences sent by our integration scripts). But there's otherwise nothing additional we should need to do on the shell integration side. It would be fine to remove the |
Agreed. In this case, I think we should focus on the core support first which will certainly require some ingenuity. |
I've been exploring some approaches, and I think there are three ways to go: Cell-based
This approach favors the read path. It's easy to check a cell's type, and ranges/zones can be derived through cell-wise iteration. Two are two more complex aspects to this approach:
Aside from additional command data, this approach also doesn't add any new memory allocations unless we find we need to cache some of the ranges for the new semantic operations. We instead use some of the reserved bit space from our existing I've implemented the guts of this in a local branch with good results so far. Pin-based
I haven't built this out, but I think this approach might be trading the base-level simplicity of using tracked pins with the added need for more higher-level management data structures and routines (e.g. a screen-level cache of "semantic spans"). Aside from the benefit of getting the base-level tracking Hyperlink-likeInstead of building directly on the existing This approach has at least the same costs as the Overall, I think the |
Our support for semantic prompts (OSC 133) is currently row-based. It should be region-based, allowing semantic prompts to span multiple rows and allowing a row to contain multiple semantic prompts.
Row-based support is too limiting and has led to problems like #3003, where we needed to change the way we emit prompt markers to work around the implicit "last prompt marker on a row wins" behavior of the current implementation.
Region-based support would also let us reliably support more advanced prompt behavior, such as styling different prompt regions, collapsing prompts and their output, and implementing more advanced selections and click-based movements. Here are some examples from DomTerm:
Prompt region styling
Command output collapsing
Prompt-aware selection
Notes
SemanticZone
type that is created by semantic prompt markers. This could be a nice generalization to adopt.cl
(click-move) option #1966 exists to specifically track the click-based movement part of the specification. This would be a nice-to-have, but it's not important as the other fundamentals described here.The text was updated successfully, but these errors were encountered: