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

Select and copy TAB characters without expanding to spaces #7810

Open
KalleOlaviNiemitalo opened this issue Oct 2, 2020 · 7 comments
Open
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Conhost For issues in the Console codebase
Milestone

Comments

@KalleOlaviNiemitalo
Copy link

Description of the new feature/enhancement

After outputting a text file to the terminal, I want to copy part of it to the clipboard without expanding TAB characters to spaces. So that I can then paste it to a different file in which TAB characters are required.

Proposed technical implementation details (optional)

Remember which character cells were output as spaces and which ones were skipped over by TAB characters. When selecting text with the mouse, select entire TAB characters instead of individual character cells. Copy the TAB characters to the clipboard.

The macOS Terminal app has this feature. It does not preserve TAB characters in the following situations:

  • If outputting the TAB character moves the cursor over character cells of which at least one contains a different character already.
  • If the TAB character has already been output and a different character is then output to any of the character cells spanned by the TAB character.

I did not test whether the macOS Terminal app preserves TAB characters if they are moved using SCROLL LEFT, SCROLL RIGHT, or INSERT CHARACTER control functions, or if tabulation stops are changed. I think it would be OK to expand TAB characters to spaces in those situations.

Related:

@KalleOlaviNiemitalo KalleOlaviNiemitalo added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Oct 2, 2020
@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 Oct 2, 2020
@DHowett
Copy link
Member

DHowett commented Oct 2, 2020

Yeah, I think this is totally worthwhile!

It's also going to be hard. Our buffer needs a deep rethink on how it stores a great number of things. 😄

@DHowett DHowett added Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Product-Conhost For issues in the Console codebase and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 2, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 2, 2020
@DHowett DHowett added this to the Console Backlog milestone Oct 2, 2020
@Diego-TorresDev
Copy link

Diego-TorresDev commented Oct 2, 2020 via email

@KalleOlaviNiemitalo
Copy link
Author

If the TAB characters are part of a rectangular selection, and whitespace trimming is enabled (#9706), I think they should be trimmed just like space characters.

// remove the spaces at the end (aka trim the trailing whitespace)
while (!selectionText.empty() && selectionText.back() == UNICODE_SPACE)

@Musketeer-D
Copy link

As a bioinformatics researcher, can select and copy TAB characters without expanding to spaces is the only reason that keep me using xshell while not win terminal. Please give this feature to your great terminal.
Thank you for your time !
I wish you all the best !

@Suleman-Elahi
Copy link

Any update on this?

@zadjii-msft
Copy link
Member

Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?
image
That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️

@xdml
Copy link

xdml commented May 19, 2023

As a workaround I started to use for Ubuntu staff xfce4-terminal. This terminal preserve tab character in both ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Conhost For issues in the Console codebase
Projects
None yet
Development

No branches or pull requests

7 participants