VS Code: Drag a VS Code file tab into your terminal to get the absolute path

Last updated: April 14, 2020
Drag a VS Code file tab into your terminal to get the absolute path

You can drag the file tab from VS Code straight into your terminal to get the absolute path for that file.

There is also a context menu, right click on the file tab and select:

  • Copy path

Or

  • Copy relative path

You can also bring up the Command Palette (Ctrl+Shift+P) in VS Code and search for copy path. You will find two suggestions to copy the path of the active file, or copy the relative path of the active file. This allows for a keyboard only workflow.

VS Code command palette copy path

You can also check out this Twitter thread which includes some extra information twitter.com/umaar/status/1250065767275663369

Sign up to receive a developer tip, in the form of a gif, in your inbox each week