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

terminals with native HTML support #1570

Closed
PerBothner opened this issue Apr 10, 2020 · 6 comments
Closed

terminals with native HTML support #1570

PerBothner opened this issue Apr 10, 2020 · 6 comments
Labels
delight this feature would delight users enhancement New feature or request Stale used for marking issues and prs as stale

Comments

@PerBothner
Copy link
Contributor

The DomTerm terminal emulator (and possibly others) support native embedding of fairly general HTML, including images. See features with screenshots; especially analogous to nu are these Python goodies. Inspired by the Jupyter support, I was able to get these working "by hand":

ls | to-html | domterm hcat
open foo.jpg | to-html | domterm hcat

Is there some way to automatically add the equivalent of | to-html | domterm hcat to each command? I see how the Jupyter shell does it, but that loses the benefit of a traditional shell, including the native input editor and being to run programs like emacs. The Python support (linked to above) uses the Python _repr_html__ hook, but that may not be appropriate for nu.

The domterm hcat command essentially wraps standard input with some simple escape sequences so it could be replaced by some simple shell code or an option to to-html.

@sophiajt
Copy link
Member

I like this idea - we currently imply | autoview when interactive via the cli, and the jupyter support assumes it can put | to-html at the end of each call, which generally works okay.

I think what we might want is a way to set a variable in config that will add a different automatic end to the pipeline.

If you're interested, I can talk you through how you could add something like that.

@PerBothner
Copy link
Contributor Author

PerBothner commented Apr 11, 2020

I have zero experience with Rust - though I am a programming-languages guy, and have been interested in it for a while, so I can probably give it a shot.

I assume you mean a way to replace | autoview with a custom pipe-line consumer, at the shell level?
I took a quick glance at autoview.rs and to_html.rs. Neither are super complicated - but they're not something you want people to have to write.

It might be reasonable to extend to-html with options for arbitrary strings (escape sequences) that would be prepended and appended to the output. That would avoid the need to execute domterm hcat (or the equivalent for other UIs). Also, a to-html option to specify "I'm in autoview context" might be useful for future tweaking of the generated html.

@thegedge thegedge added delight this feature would delight users enhancement New feature or request labels Apr 11, 2020
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale used for marking issues and prs as stale label Jun 24, 2021
@github-actions
Copy link

github-actions bot commented Jul 7, 2021

This issue has been marked stale for more than 10 days without activity. Closing this issue, but if you find that the issue is still valid, please reopen.

@PerBothner
Copy link
Contributor Author

Perhaps this issue should be re-opened now that PR #6786 exists, I believe this requires a maintainer.

@sholderbach sholderbach reopened this Oct 17, 2022
@sholderbach sholderbach removed the Stale used for marking issues and prs as stale label Oct 17, 2022
@github-actions github-actions bot added the Stale used for marking issues and prs as stale label Jan 17, 2023
@sophiajt
Copy link
Member

sophiajt commented Aug 9, 2023

Closing, as Nushell's focus for 1.0 is trying to be broad rather than lighting up functionality for specific terminals.

@sophiajt sophiajt closed this as completed Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delight this feature would delight users enhancement New feature or request Stale used for marking issues and prs as stale
Projects
None yet
Development

No branches or pull requests

4 participants