Skip to content
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

Feature Request: Take screenshot of selection/viewport #1084

Open
mcpiroman opened this issue May 31, 2019 · 12 comments
Open

Feature Request: Take screenshot of selection/viewport #1084

mcpiroman opened this issue May 31, 2019 · 12 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@mcpiroman
Copy link
Contributor

Summary of the new feature/enhancement

You can take a screenshot of whole window with Alt+Prt Scr, but it would be handy if one could do so only on selected text.
With box selection this would contain selected area, whereas with regular selection it would contain every selected line.

In profile settings one could be able to choose whether the background of taken screenshot should be the actual displayed background or something else (probably solid color). This would ease making tutorials or reports, when one doesn't want to show what's behind the terminal.
Other option could be additional marigin, as so the first pixel of text isn't the first pixel of image.

I'm not sure about appropriate shortcut, meaby some Func+Prt Scr?

Proposed technical implementation details (optional)

I can see this being solved either by taking regular screen shot or re-rendering selected text to buffer. Idk which option's better, but with custom background it seem's like the second one.

@mcpiroman mcpiroman added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 31, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 31, 2019
@DHowett-MSFT
Copy link
Contributor

Thanks for the request! I think this is largely served by the windows snipping tool, Win+Shift+S, which does a way better job (it's got box selection, lasso selection, a timer, etc.) than we could at a significantly reduced engineering cost. 😄

I realize that doesn't let you manipulate the background or change the padding, but I'm not certain that the Terminal is the right place to do this work.

I'll leave this open for another team member to comment on.

@mcpiroman
Copy link
Contributor Author

mcpiroman commented May 31, 2019

I should have cleaned out what's the main purpose of this:
I do a lot of screenshoting the console with such tools and the main problem is that you have to precisly match the text you want to select. Otherwise you can cut a few pixels of a bottom of a line, or include few pixels of the next line. This is even harder when text begins at first pixel of a terminal window (so 1 pixel to the left and you include sth outside window, 1 pixel to the right and you cut first letter).

With this feature one could easly tripple click whole line (when that's implemented), click some shortcut and he ends up with nice, pixel perfect screenshot.

If this could be done be the screenshot tool aligning to console text, I'd be fine.

@miniksa
Copy link
Member

miniksa commented May 31, 2019

Is this perhaps just another format of data to be put onto the clipboard with Ctrl+C?

plain text, rtf text, html text... and a png?

@mcpiroman
Copy link
Contributor Author

@miniksa Most probably, but I wouldn't go with Ctrl+C. Or meaby the screenshot (or some other data, like area coords) should be sent to snipping tool.

@phuclv90
Copy link

phuclv90 commented Jun 2, 2019

In general texts should remain as texts. In Word, Excel... or any where you can just paste the text from the console and format as monospaced. That'll make it more readable and you can also zoom without loss of quality

@mcpiroman
Copy link
Contributor Author

mcpiroman commented Jun 2, 2019

@phuclv90 Although ideally it's true that it's best to store terminal's state as text, it's not always applicable.
You can usually just copy the text and style it to look like terminal but that's not so easy (custom font's, terminal's transparent background, emojis), and sometime's your required to provide the actual screenshot, as a prove of doing something (not that it couldn't be deceived). (btw. is/will be multi color text (foreground and backgound) copy supported? If so, is it ms office only format?)
Thus I still consider the ability to quickly take a nicely text-aligned screenshot as valuable.

@phuclv90
Copy link

phuclv90 commented Jun 3, 2019

@mcpiroman regarding formatted text some terminals do support copying that. Most often they'll have to put multiple formats in the clipboard (at least text + rtf + html) and the app where you paste will choose the format they want

For auditing it's still better to use some tools like the script command

@zadjii-msft
Copy link
Member

I believe @carlos-zamora is already working on HTML & RTF copy/paste, so watch out for PR's in this area soon :)

@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels Jun 3, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 3, 2019
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Jun 3, 2019
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jun 3, 2019
@mcpiroman
Copy link
Contributor Author

If accurately styled text copy was a thing, that would definitly cover most use cases of terminal recording, and in more robous way than screenshot. You could even produce html that looks like the terminal window itself, but that's maybe to much ;).
One more thing to I'd like to ask is if wouldn't it be relatively easy to expose api which would return screen coordinates of charracters' bounds? That could be eventually consumed by screenshot programs (maybe windows snipping tool) to snap to the text grid. If so, even though text copy is the ideal case, I or others might still find that useful. Ofc that isn't anything critical, I'm just curious.

@carlos-zamora
Copy link
Member

@cinnamon-msft and I were actually discussing the possibility of making a setting for triple-click to select "the entire row" vs "the entire viewport". Sounds like you want an actual keybinding though so that shouldn't be too much additional work.

@mcpiroman
Copy link
Contributor Author

As a note, Markdown (and so GitHub or StackExchange) don't support colorful text (even in html). So for full styling, image is the only option here (AFAIK).

@carlos-zamora carlos-zamora removed their assignment Jul 29, 2019
@zadjii-msft zadjii-msft changed the title Feature Request: Take screenshot of selection Feature Request: Take screenshot of selection/viewport Apr 17, 2023
@zadjii-msft
Copy link
Member

From #15147: if there's no selection, maybe the action should just export the entire viewport to the image file.

Also noted from discussion: This might be Hard to include all the XAML-y bits, like the background image & acrylic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

6 participants