Skip to content

Add skeleton code for bracketed paste mode#8840

Merged
5 commits merged intomicrosoft:mainfrom
skyline75489:chesterliu/dev/bracket-paste-part-1
Jan 22, 2021
Merged

Add skeleton code for bracketed paste mode#8840
5 commits merged intomicrosoft:mainfrom
skyline75489:chesterliu/dev/bracket-paste-part-1

Conversation

@skyline75489
Copy link
Collaborator

@skyline75489 skyline75489 commented Jan 21, 2021

This adds the skeleton code for "bracketed paste mode" to the Windows
Terminal. No actual functionality is implemented yet, just the wiring
for handling DECSET/DECRST 2004.

References #395
Supersedes #7508

@skyline75489
Copy link
Collaborator Author

I think I should add a TODO in the comment, but I don't really know where is the best place. Also maybe filing another issue to actually implement "bracketed paste mode"?

@DHowett
Copy link
Member

DHowett commented Jan 21, 2021

We can continue using 395. 😄

@skyline75489
Copy link
Collaborator Author

We can continue using 395. 😄

I'm totally OK with it.

So this is just another trivial PR. Don't know if it can make it to the 1.6 release train, but here it is.

case DispatchTypes::ModeParams::ASB_AlternateScreenBuffer:
fSuccess = fEnable ? UseAlternateScreenBuffer() : UseMainScreenBuffer();
break;
case DispatchTypes::ModeParams::XTERM_BracketedPasteMode:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no test case for like Win32InputMode. So I didn't add one for BracketedPasteMode. Adding one would be trivial, though.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh this looks fine to me. We're not really adding anything too interesting here, so the rest is pretty straightforward. I'll make sure that @DHowett gets his eyes on this, since he's the bracketed-paste expert

@zadjii-msft zadjii-msft added the Area-VT Virtual Terminal sequence support label Jan 21, 2021
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, but it's a small PR so I'll block for now 😄

// - enabled - true to enable, false to disable.
// Return value:
// True if handled successfully. False otherwise.
bool TerminalDispatch::EnableBracketedPasteMode(const bool enabled) noexcept
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this be called EnableXtermBracketedPasteMode, just to add more "namespacing". Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I'm OK with changing this. But is there any other BracketedPasteMode that't not Xterm-licensed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I thought I had a stronger case. It looks like our other "Enable" methods are split 50/50 on whether they have the "origin" (where they came from) -- "[VT220]MouseMode", "[DEC]COLMSupport", "[Win32]InputMode". The others don't. Thanks for making the change anyway 😄

return success;
}

//Routine Description:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment format should have spaces after the /

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know I copied it from the other methods in this file. Take a look at them then you know why it looks like this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH. Okay. I don't care then! I won't make you fix that 😄

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 22, 2021
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 22, 2021
@ghost
Copy link

ghost commented Jan 22, 2021

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 124cbd9 into microsoft:main Jan 22, 2021
@skyline75489 skyline75489 deleted the chesterliu/dev/bracket-paste-part-1 branch January 22, 2021 12:33
mpela81 pushed a commit to mpela81/terminal that referenced this pull request Jan 28, 2021
This adds the skeleton code for "bracketed paste mode" to the Windows
Terminal. No actual functionality is implemented yet, just the wiring
for handling DECSET/DECRST 2004.

References microsoft#395
Supersedes microsoft#7508
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-VT Virtual Terminal sequence support AutoMerge Marked for automatic merge by the bot when requirements are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants