-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Linkifier: CSS styling of linkified links #1540
Comments
Since v3 we use a canvas to render by default which makes it not possible to do this. if you want to embed something on hover this is possible using the current API by listening to the tooltip and leave callbacks: Lines 227 to 268 in 1395b0f
If you need some other capability let us know some more specifics about the use case. |
@Tyriar But it is impossible to display a link in some special way? (without hovering) Details: I want to use xterm.js in one of my projects (cheat.sh), where I use manual HTML generation currently. Here you see a (wrong) HTML representation of the original representation, $ curl cheat.sh xterm.js represents it correctly, but what I miss here is the CSS support for hyperlinks. Ideally, I would replace this gtihub link with a github button and so on. |
Yes, this too, but it is much more than that. Currently I use xterm.js in experimental mode: You will get a shell here, where the user can ask any programming language questions: For example, try this:
Of course, you can try any question you want, not only this one The answer may contain links to some external resources (for example here: links to the stackoverflow answer where this information was found, to the author and to the license). I want to display this links as links. Of course, you may ask, how xterm.js should now that that are links, and what are the hrefs of these links? This information is known (though not displayed, but it is available to a JS script running on the page). This information looks like a dictionary:
How should I solve this task? |
So there's two ways I see this being solved:
|
(by the way, Daniel, maybe you could give me a hint, how could we create a cheat.sh plugin for visual studio, so that people could send the queries directly from, Visual Studio not leaving it? We've already created plugins for Vim, Emacs and currently are working on a sublime plugin. Is it a good starting point? https://msdn.microsoft.com/en-us/library/bb166030.aspx?f=255&MSPPError=-2147217396 Please ignore this question if it seems to be irrelevant for you; it is irrelevant indeed; I've just noticed that you are working at the Visual Studio team, that's why I've asked it) |
Thank you very much for the answer, I think that both answers are appropriate, but the first one can be implemented just now, as far as I can judge. And with the second way, even if it will be implemented, it still would not be possible to display links in some fancy way (like a GitHub button or whatever). |
I don't know anything about VS extensiblity unfortunately.
Yep, it should work 🙂
We are starting to open up extensibility within xterm.js which you can read about in #1128. Once we progress more I this I can see us opening up APIs for the buffer which could potentially enable things like this. |
Would it possible to specify some CSS style for linkified links?
It would be even better if it would be possible to specify different CSS styles basing the links text/content.
By means of this mechanism, we could embed various HTML objects in the terminal output (or better to interpret it as such). But even plain CSS styles would be really great.
(maybe it is already possible, but after going through the documentation and the code I didn't manage to find out how)
The text was updated successfully, but these errors were encountered: