Open .ts, .tsx files in Visual Studio Code by default on Mac

Select a sample file such as component.tsx in Finder, press Command–I, choose Visual Studio Code under Open with, and click Change All. Confirm the change, then double-click another file of the same type to test it.

TypeScript and TSX contain source code, but the .ts extension can also identify a transport-stream video. Check the file contents and origin before applying a type-wide editor default.

Method 1: Use Finder

  1. In Finder, select a sample file such as component.tsx.
  2. Press Command–I, or choose File → Get Info.
  3. Expand Open with and choose Visual Studio Code. If it is missing, choose Other and locate the installed app.
  4. Click Change All and confirm the macOS prompt.
  5. Double-click another file of the same type to check the new default.

Method 2: Manage associations with Pahkui

Pahkui lets you browse by app or by format. When setting up an editor for several file types, you can inspect the current defaults and review pending changes in one window. Requires macOS 14 or later.

  1. Open Pahkui, switch to Format, and search for the extension you need from .ts, .tsx.
  2. Select Visual Studio Code. Use Choose another app if it is not listed.
  3. Review the pending association, click Apply changes, and confirm the new app in the macOS dialog.

The formats in this guide require Pahkui Pro, a one-time purchase for lifetime use. The manual Finder method does not require a purchase. See pricing

Pahkui interface for browsing file associations by format
Browse associations by format. The screenshot illustrates the interface; select your own file type in the app.

If the default app does not change

  • Use a genuine TypeScript source file as your sample. A .ts video should be opened in a media player instead.
  • For JSX markup, check .tsx separately from .ts. Project build tools are still needed to compile the source.
  • If Visual Studio Code is missing, confirm it is installed and can open the sample directly, then locate it with Other. If an extension is absent from the catalog, add the format in Pahkui. Changing an association does not add format support to the target app.

Common questions

Why does my .ts video open in an editor?

The same extension can represent different contents. Use Open With for the exception, or reconsider a global .ts editor association if most of your files are videos.

How do I restore the previous app for .ts, .tsx?

Choose the previous app again in Finder or Pahkui and confirm the change. This updates the type association without deleting files. Use the Open With context menu for a one-time exception.

References

Open files with the apps you prefer

Browse formats and default apps, review your choices, and apply changes with Pahkui.

Download for Mac

Related guides

Browse all apps and formats