Skip to content

A Visual Studio Code extension that allows you to quickly open the folder containing any file in Windows Total Commander directly from WSL Ubuntu. Perfect for developers working in WSL who want to access their files through Total Commander's powerful file management interface.

Notifications You must be signed in to change notification settings

andrewgmercader/VSC_Open_in_Tcmd_from_WSL

Repository files navigation

mi-open-tcmd README

mi-open-tcmd is a Visual Studio Code extension that allows you to quickly open the folder containing any file in Windows Total Commander directly from WSL Ubuntu. Perfect for developers working in WSL who want to access their files through Total Commander's powerful file management interface.

Features

  • Right-click integration: Right-click on any file in the Explorer or Editor to open its containing folder in Total Commander
  • WSL to Windows path conversion: Automatically converts WSL Ubuntu paths to Windows paths that Total Commander can understand
  • Configurable Total Commander path: Customize the path to your Total Commander installation
  • Flexible arguments: Configure Total Commander startup arguments to control panel behavior and opening mode

Main functionality:

  • Converts paths like /home/user/project/file.js to \\wsl.localhost\Ubuntu-22.04\home\user\project\
  • Opens Total Commander directly in the correct folder
  • Works seamlessly between WSL Ubuntu and Windows environments

Requirements

  • Windows 10/11 with WSL2 enabled
  • Ubuntu 22.04 (or compatible WSL distribution)
  • Total Commander installed on Windows
  • Visual Studio Code running in WSL Ubuntu environment

Extension Settings

This extension contributes the following settings:

  • mi-open-tcmd.totalCommanderPath: Full path to Total Commander executable in Windows

    • Default: "C:\Program Files\totalcmd\TOTALCMD64.EXE"
    • Common alternatives:
      • "C:\Program Files (x86)\totalcmd\TOTALCMD.EXE" (32-bit)
      • "C:\totalcmd\TOTALCMD64.EXE" (custom installation)
  • mi-open-tcmd.totalCommanderArgs: Additional arguments for Total Commander

    • Default: "/O /T"
    • Available options:
      • /O = Open new tab if Total Commander is already running
      • /T = Specify target directory
      • /L = Load directory in left panel
      • /R = Load directory in right panel
      • /S = Open in separate instance
    • Example configurations:
      • "/O /R" = Open in new tab, right panel
      • "/S /T" = Open in separate instance
      • "/O /L" = Open in new tab, left panel

Usage

  1. Right-click method: Right-click on any file in VS Code's Explorer panel and select "Abrir con Total Commander"
  2. Editor method: Right-click in any open file editor and select "Abrir con Total Commander"
  3. Command Palette: Open Command Palette (Ctrl+Shift+P) and search for "Abrir con Total Commander"

Configuration Examples

Settings.json configuration:

{
  "mi-open-tcmd.totalCommanderPath": "C:\\totalcmd\\TOTALCMD64.EXE",
  "mi-open-tcmd.totalCommanderArgs": "/O /R"
}

VS Code Settings UI:

  1. Go to File > Preferences > Settings (or Ctrl+,)
  2. Search for "Total Commander"
  3. Modify the path and arguments as needed

Known Issues

  • Path with spaces: Folders with spaces in their names are supported and handled correctly
  • WSL distribution: Currently configured for Ubuntu-22.04. Other distributions may require path adjustments
  • Total Commander not found: If you get an error, verify the Total Commander path in settings
  • Development mode: When testing with F5, configure settings in the development instance, not the main VS Code window

Troubleshooting

  1. Extension not working: Check that Total Commander path is correct in settings
  2. Wrong directory opens: Verify that WSL path conversion is working by checking the console output
  3. Permission errors: Ensure Total Commander has proper permissions to access WSL paths

Release Notes

0.0.1

Initial release of mi-open-tcmd:

  • Basic functionality to open folders in Total Commander from WSL
  • Configurable Total Commander path and arguments
  • Right-click context menu integration
  • WSL to Windows path conversion
  • Support for paths with spaces

Technical Details

This extension works by:

  1. Capturing the file path from VS Code's WSL environment
  2. Converting the WSL path format to Windows UNC path format
  3. Using wslpath command for accurate path conversion
  4. Executing Total Commander with the converted path via cmd.exe

The path conversion transforms:

  • From: /home/andrew/project/file.js
  • To: \\wsl.localhost\Ubuntu-22.04\home\andrew\project\

Following Extension Guidelines

This extension follows VS Code's extension guidelines and best practices for creating extensions.

Enjoy seamless file management between WSL and Windows!

About

A Visual Studio Code extension that allows you to quickly open the folder containing any file in Windows Total Commander directly from WSL Ubuntu. Perfect for developers working in WSL who want to access their files through Total Commander's powerful file management interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published