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

Support copying text (OSC52) & hyperlinks (OSC8) #80

Closed
wants to merge 9 commits into from

Conversation

aymanbagabas
Copy link
Collaborator

@aymanbagabas aymanbagabas commented Apr 29, 2022

  • Add OSC52 to support copying text
  • Add OSC8 to support hyperlinks

OSC52 needs to read $TERM to determine the terminal. This implements two interfaces, File and Environ, and uses them when creating a new Output.

termenv.Output can be initialized with a custom os.File as an output and
supports auto detection of its capabilities. Alternatively you can also
skip auto detection and create a new instance with a specific profile.

Styles (just like Colors) can now be created for specific profiles, with
the Ascii profile stripping away any applied styling.
Copy link
Collaborator

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

looks great

@aymanbagabas aymanbagabas changed the title Support copying text using OSC52 Support copying text (OSC52) & hyperlinks (OSC8) May 18, 2022
support copying text on supported terminals
.gitignore Show resolved Hide resolved
| Windows Terminal | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |

[^vte]: This covers all vte-based terminals, including Gnome Terminal, guake, Pantheon Terminal, Terminator, Tilix, XFCE Terminal.
| Terminal | Alt Screen | Query Color Scheme | Query Cursor Position | Set Window Title | Change Cursor Color | Change Default Foreground Setting | Change Default Background Setting | Copy (OSC52) | Hyperlinks (OSC8) |
Copy link
Owner

Choose a reason for hiding this comment

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

Since this starts horizontally scrolling on GitHub, we should think about breaking this up in two tables maybe: standard and advanced feature sets or something.

@aymanbagabas
Copy link
Collaborator Author

closing this in favor of #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants