How to refer to current file from Integrated Terminal in Visual Studio Code

You could, as a workaround, use the new abilty to send variables like ${file} to the terminal with such a keybinding (see vscode docs). In your keybindings.json file add:

{
  "key": "ctrl+shift+t",
  "command": "workbench.action.terminal.sendSequence",
  "args": { "text": "'${file}'\u000D" }
}

Then, in the terminal type some_command and hit Ctrl-Shift-T and the current filename will be appended and the command run.

\u000D is a return.


Based on the above answer with activation only when the terminal is in focus:

{
  "key": "ctrl+shift+t",
  "command": "workbench.action.terminal.sendSequence",
  "args": { "text": "'${file}'\u000D" },
  "when": "terminalFocus"
}