posit-dev / posit-dev/positron

Add a Console link provider API so extensions can contribute clickable links in the Positron Console

Open
#12,975 1 comment 0 reactions 1 assignee View on GitHub

@samclark2015 is already working on this.

Since Jul 6, 2026.

area: api area: console enhancement support
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Description

Summary

Positron currently supports clickable hyperlinks in the Console when they are already present in the output stream, for example standard URLs or OSC 8 hyperlinks. However, extensions do not currently have a way to contribute clickable links for arbitrary Console text the way they can for terminals with VS Code's TerminalLinkProvider.

It would be useful to expose a Console-specific extension API that allows extensions to analyze rendered Console output and return clickable ranges with destinations.

Motivation

There is a real class of extension features that works well in terminals today but does not have a good equivalent in the Positron Console.

One concrete example is my tarborist extension for {targets} pipelines in R:

  • the extension statically analyzes the pipeline and knows the source location of each target
  • when {targets} prints progress/output in the Console, target names appear in the output
  • it would be very helpful if those target names could be clickable, taking the user directly to the corresponding definition in _targets.R.

This kind of feature is straightforward in a terminal-backed workflow because an extension can use a terminal link provider. In the Positron Console, there is currently no comparable API for arbitrary Console text.

Proposed feature

Add a Console-specific link provider API, analogous in spirit to TerminalLinkProvider, but designed for the Positron Console.

At a high level, an extension should be able to:

  • register a provider for a language, such as r
  • receive rendered Console lines plus session/language context
  • return one or more ranges in that line that should be clickable
  • associate each range with a URI and optional tooltip
  • let Positron render those ranges as clickable links without interrupting streaming output

Why this would improve extension development

This would let extensions build richer interactive Console experiences without resorting to language-specific output rewriting hacks. It would also make the Positron Console more feature-complete relative to terminal-backed workflows for extensions that already know how to detect meaningful entities in text output.

Example implementation

I have put together a feature branch of Positron that implements this feature to demonstrate. This branch introduces a Console-specific link provider API for Positron and wires it through the ext host, main thread, and console service. Extensions can register console link providers by language with positron.window.registerConsoleLinkProvider(...). The console renderer resolves links per rendered line and rewrites matching spans into ANSIOutputRun hyperlinks, reusing the existing hyperlink behavior.

This version implements:

  • new ConsoleLink, ConsoleLinkContext, and ConsoleLinkProvider API types
  • ext-host/main-thread RPC for provider registration and link resolution
  • console service support for registering providers and merging link ranges
  • renderer updates to resolve links for ActivityItemOutputMessage lines

Here is the branch:

https://github.com/tylermorganwall/positron/tree/feature/console-link-provider

Here is a video of the tarborist extension providing links in the Console via the implementation in the above Positron branch:

https://github.com/user-attachments/assets/25606193-8b7f-4888-ab4e-e61220144b9d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.