Bug 201870 - [terminal][api] Hyperlinks support in Terminal
Summary: [terminal][api] Hyperlinks support in Terminal
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: terminal (show other bugs)
Version: Next   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-08-31 04:36 EDT by Mikhail Kalugin CLA
Modified: 2020-09-04 15:12 EDT (History)
7 users (show)

See Also:


Attachments
patch for org.eclipse.tm.terminal (13.99 KB, patch)
2007-08-31 04:36 EDT, Mikhail Kalugin CLA
no flags Details | Diff
patch for org.eclipse.tm.terminal.view (1.26 KB, patch)
2007-08-31 04:37 EDT, Mikhail Kalugin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kalugin CLA 2007-08-31 04:36:46 EDT
Created attachment 77446 [details]
patch for org.eclipse.tm.terminal

We are working on hyperlinks support for terminal. The main goal is to create clickable entries from paths in the terminal.

Unfortunately now Terminal do not provides any solution to extend it in the way we want, so patched terminal to add some extensibility and achieve our goals:

* changed StyledText to TextViewer in TerminalControl class so JFace hyperlink manager could be installed
* added TerminalHyperlinkDetectorsExtension - manager for extension point org.eclipse.tm.terminal.hyperlinkDetectors. So IHyperlinkDetector object could be contributed.
* changed TerminalViewControlFactory interface to fit standard Factory pattern and added hyperlink detectors installation code
* TerminalView class updated to support new factory interface
* added TerminalConnectorsManager that allows to fetch ITerminalConnectorInfo by ITextViewer  (used for getting connection info for hyperlinks).

It would be great if you’d consider to review/apply this changes. This changes affect overall Terminal extensibility and we believe would be useful for other DSDP TM adopters.

Also if proposed solution is not acceptable for some reasons, please could you propose any other approach for us to implement desired functionality.
Comment 1 Mikhail Kalugin CLA 2007-08-31 04:37:27 EDT
Created attachment 77447 [details]
patch for org.eclipse.tm.terminal.view
Comment 2 Martin Oberhuber CLA 2007-09-03 11:29:00 EDT
I'm not happy with the patch for two reasons:

1.) The tm.terminal widget is written to allow running with minimal dependencies,
    so it should eventually work in an eRCP platform, see
    http://www.eclipse.org/ercp/
    But eJface does not have a TextViewer...

2.) The tm.terminal implementation is currently being rewritten to improve
    performance. Codebase is totally new, so the patch would not apply 
    easily.

Conceptionally, I like the idea of making the terminal rendering configurable by extensions. Michael, what do you think about this idea and the patch?
Comment 3 Martin Oberhuber CLA 2008-03-03 12:41:31 EST
Mikhail did you have a look at the new fast Terminal implementation introduced with TM 2.0.1 and made reliable since? Do you see any way supporting things like hyperlinks in there?

I'd like to think about making Terminal extendable in the future.
Comment 4 Hemang Lavana CLA 2008-03-03 16:51:08 EST
I like the idea of making the terminal rendering configurable by extensions. The hypertext support is however universally needed, so such an extension should be included as optional feature with tm that is enabled based on target platform (it could be disabled for eRCP if it cannot be rendered on that platform).
Comment 5 Michael Scharf CLA 2008-03-31 22:07:19 EDT
I have been thinking about adding hyperlink support to the terminal when I rewrote it with a faster implementation. The old implementation was based on SWT text which caused all kinds of performance problems. The patch does not apply to the current version. The new terminal does its own drawing. 

The basic idea is to add an userData to org.eclipse.tm.terminal.model.Style. Each character of a hyperlink would have the the hyperlink data added as userData. Style would also have to be refactored to use a WeakMap or another mechanism to prevent memory leaks, because it currently keeps all styles ever used in a cache. 

Then a mechanism (extension point) for actions on characters with style needs to be invented. It could be done by making the used data IAdaptable and provide adapters to handle the context menu and mouse events....

Because of the sharing of Styles, equals and hashCode are important, therefore the attached userData has to implement a reliable equals/hashCode.
Comment 6 Martin Oberhuber CLA 2011-03-11 15:56:51 EST
I have seen Aptana Studio 3 support hyperlinks in the Terminal, git revision da1566c99656f8efb793aca57043c8e4e0abff6a of 11-Nov-2010 talks about moving hyperlink support from their Open Source clone into their proprietary add-on:

https://github.com/aptana/studio3/tree/development/plugins/org.eclipse.tm.terminal
https://github.com/aptana/studio3/tree/development/plugins/com.aptana.terminal

It would be great to see some discussion about the attached patches by the contributors, and eventually agree on an API and/or implementation to put into the Open Source TM Terminal.

API Freeze is nominally with M6 (next week), but since the Terminal API is provisional anyways I'd accept contributions until M7 (Feature Freeze, 2-May as per the Project Plan).

I'm setting the target milestone 3.3M7 for now hoping that we can put something together. Removing Michael as Assignee since we at Wind River won't have much time to help out other than reviewing patches.
Comment 7 Martin Oberhuber CLA 2011-05-31 17:41:52 EDT
Moving deferred 3.3 api items to 3.4
Comment 8 Martin Oberhuber CLA 2013-03-06 07:16:05 EST
See:ELT

Note that this has been implemented in a Fork of the TM Terminal, Google ELT:
http://code.google.com/p/elt/
as well as another fork of the TM Terminal, in Aptana Studio:
http://www.aptana.com/products/studio3/download

It would be great for those forks to contribute back the functionality they have added.
Comment 9 Martin Oberhuber CLA 2015-05-22 12:51:31 EDT
With Terminal 4.0 coming to Mars, would the guys from ELT or Aptana be interested to contribute back their extension ?

I think that the original demand for the Terminal Widget to run on eRCP is not relevant any more these days, so this might simplify contributions... clickable hyperlinks in the Terminal are definitely an interesting concept that I'd love to see contributed !
Comment 10 Angelo ZERR CLA 2016-06-15 08:53:21 EDT
@Martin, is there any chance that Hyperlink could be implemented? In my case I would like to support Hyperlink for angular-cli.

Ex: user type the command: "ng new mycomponent" and there is a trace like this:

----------------------
creating src/mycomponent.ts
----------------------

I would like have an hyperlink for src/mycomponent.ts .

Thanks for this support.
Comment 11 Jonah Graham CLA 2020-05-01 10:10:28 EDT
The Terminal component of the Eclipse Ecosystem has a new home. The Terminal is now part of the Eclipse CDT project[1].

This change means a new Git repo[2], P2 site[3] and Bugzilla component. The terminal will continue to be delivered as part of the quarterly Simultaneous Release of Eclipse as well.

The marketplace entry[4] had not been updated in a few years. It will once again install the latest release of the terminal on the latest release of the whole IDE (currently 2020-03).

If this bug is no longer relevant, please feel free to comment or close the bug. If you can confirm if this issues still occurs in the latest release please do let me know in a comment.

[1] https://wiki.eclipse.org/CDT/User/NewIn911
[2] https://git.eclipse.org/c/cdt/org.eclipse.cdt.git (in the terminal directory)
[3] current release is 9.11 - P2 site https://download.eclipse.org/tools/cdt/releases/9.11/
[4] https://marketplace.eclipse.org/content/tm-terminal

(This comment was added to all open terminal bugs along with changing the Product/component pair to CDT/terminal.)