microsoft / microsoft/TypeScript
Add support for OSC8 hyperlinks in TTY output
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 132
Description
### 🔍 Search Terms
"OSC8", "hyperlinks", "terminal emulator", "tty", "build output"
### ✅ Viability Checklist
- [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [x] This wouldn't change the runtime behavior of existing JavaScript code
- [x] This could be implemented without emitting different JS based on the types of the expressions
- [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- [x] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- [x] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
### ⭐ Suggestion
Wrap file paths from build output with [OSC8 hyperlink](https://github.com/Alhadis/OSC8-Adoption) markers.
### 📃 Motivating Example
When the build output contains errors, it is convenient to be able to CMD+click on files path to directly see the error in the editor.
Most modern terminal emulators (iTerm, Ghostty, tmux, etc.) support CMD+clicking on file names in order to open them in the default app. These terminals use two different approaches to enable this; OSC8 hyperlinks and RegExp. The issue with the Regexp based approach is that their behavior is inconsistent across terminal implementations, making them unreliable. OSC8 hyperlinks, on the other hand, are unambiguous and reliable.
### 💻 Use Cases
1. What do you want to use this for?
When building a TS project, a change in a dependency might cause issues in dependent code, causing `tsc build` to return errors.
2. What shortcomings exist with current approaches?
Currently, I can sometimes CMD+click the filename, but this often fails (because the terminal does not properly infer the actual file location using the RegExp based method)
3. What workarounds are you using in the meantime?
Manually copy the file path in the terminal output + Manually open IDE + Manually open file
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
L’issue indique que la sortie de build et la sortie TTY font partie du périmètre, mais ne fournit ni fichiers ni tests. Commencez par déterminer où tsc build formate les chemins de fichiers et les diagnostics du terminal ; le travail est terminé lorsque les chemins de fichiers sont entourés de marqueurs OSC8 sans modifier le comportement JavaScript existant.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- cli, developer-experience
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100