Opening files in IDE by one click from Tracy's page

When error page is displayed, you can click on a file name to open relevant file in your editor, of course having having cursor in appropriate line of code. To make all this work, you need to configure your system little bit.

If not configured otherwise by re-setting variable Tracy\Debugger::$editor, Debugger will open files using URL having this format: editor://open/?file=%file&line=%line, i.e. using “editor://” protocol. You need to register a handler in your system, which can be any executable file able to process passed URL.


1. Create “editor://” protocol handler in form of a batch file run-editor.js

// NetBeans
var editor = '"C:\\Program Files\\NetBeans 6.9.1\\bin\\netbeans.exe" "%file%:%line%" --console suppress';

// PHPEd
//~ var editor = '"C:\\Program Files\\NuSphere\\PhpED\\phped.exe" "%file%" --line=%line%';

// PhpStorm
//~ var editor = '"C:\\Program Files\\PhpStorm\\PhpStorm.exe" --line %line% "%file%"';

// SciTE
//~ var editor = '"C:\\Program Files\\SciTE\\scite.exe" "-open:%file%" -goto:%line%';

// EmEditor
//~ var editor = '"C:\\Program Files\\EmEditor\\EmEditor.exe" "%file%" /l %line%';

// PSPad Editor
//~ var editor = '"C:\\Program Files\\PSPad editor\\PSPad.exe" -%line% "%file%"';

// gVim
//~ var editor = '"C:\\Program Files\\Vim\\vim73\\gvim.exe" "%file%" +%line%';

var url = WScript.Arguments(0);
var match = /^editor:\/\/open\/\?file=(.+)&line=(\d+)$/.exec(url);
if (match) {
    var file = decodeURIComponent(match[1]).replace(/\+/g, ' ');
    var command = editor.replace(/%line%/g, match[2]).replace(/%file%/g, file);
    var shell = new ActiveXObject("WScript.Shell");
    shell.Exec(command.replace(/\\/g, '\\\\'));

2. Register “editor://” protocol in your system

Create and open editor.reg:

Be careful with backslashes and correct path to handler executable run-editor.js


@="URL:editor Protocol"
"URL Protocol"=""

@="wscript \"C:\\path\\to\\run-editor.js\" \"%1\""


1. Create “editor://” protocol handler in form of a BASH script

Create file ~/bin/,

touch ~/bin/

make it executable,

chmod +x ~/bin/

and insert following code:




# Netbeans
netbeans "$file:$line"
# PhpStorm
#phpstorm --line $line "$file"
# Kate
#kate --line $line "$file"
# Vim
#vim "$file" +$line
# Gedit
#gedit +$line "$file"
# Komodo
#komodo "$file#$line"

If you use Netbeans (or another IDE) not installed from repository, its binary probably won't be in $PATH. This can be fixed very easily, just make a symlink to IDE's executable in ~/bin directory.

2. Register “editor://” protocol in your system


Create file ~/.local/share/applications/editor-handler.desktop and add this section:

[Desktop Entry]
Name=Netbeans Editor
Exec=/home/<username>/bin/ %u

Add in ~/.local/share/applications/mimeapps.list this line:



In Gnome (works also in Gnome Shell) you can register new “editor://” protocol by configuration utility:

gconftool-2 -s /desktop/gnome/url-handlers/editor/command --type String '/home/<username>/bin/ %s'
gconftool-2 -s /desktop/gnome/url-handlers/editor/enabled --type Boolean true

for Vim or another CLI tool also add:

gconftool-2 -s /desktop/gnome/url-handlers/editor/needs_terminal --type Boolean true

Be careful with the path. Shortcut ~/ will NOT work because configuration is system-wide.

Mac OS X

If you use TextMate editor, or another supporting special URL, just configure it in $editor variable. You can use substitutions %file and %line:

// PhpStorm
Debugger::$editor = 'phpstorm://open?file=%file&line=%line';
// TextMate
Debugger::$editor = 'txmt://open/?url=file://%file&line=%line';
// MacVim
Debugger::$editor = 'mvim://open/?url=file://%file&line=%line';


  • in Firefox you may need to allow custom protocol execution in about:config by setting network.protocol-handler.expose.editor to false and network.protocol-handler.expose-all to true. It should be allowed by default however.
  • If it's not all working immediately, don't panic. Try to refresh the page, restart browser or computer. That should help.
  • Input Error: There is no script engine for file extension “.js” Maybe you associated “.js” file to another app, not JScript engine. To fix, see here

In case of more troubles or questions, ask on forum.