microsoft / microsoft/TypeScript

Add support for OSC8 hyperlinks in TTY output

Đang mở
#63,082 2 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Awaiting More Feedback Suggestion
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

### 🔍 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Issue nêu đầu ra build và đầu ra TTY là phạm vi cần thực hiện nhưng không cung cấp tệp hoặc bài kiểm thử nào. Hãy bắt đầu bằng cách lần theo nơi tsc build định dạng các đường dẫn tệp và chẩn đoán của terminal; công việc được xem là hoàn tất khi các đường dẫn tệp được bao quanh bằng các marker OSC8 mà không làm thay đổi hành vi JavaScript hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
cli, developer-experience
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.