Copy path to file (on right-click)


Something I really miss from my old IDE is that you could right click on a file in the file tree, the drop down menu would appear, and you would see a keyword stating “Copy file reference”. This would copy the path to that file, and you could paste that path into another file for access to its contents.

  • Seth


I was also looking for this feature and it’s apparently not yet (or not anymore) there. I would certainly like this.

Thanks in advance!


Sure agree here man!


Do they do any sort of upvoting on feature request. This would get my vote.


I believe this is what this forum is for, you should see an option to upvote my request.


Well, I clicked the heart which just said ‘like’ I didn’t see a specific button labeled upvote.


Liking the post itself is sufficient for voting :thumbsup:


I need it too :slight_smile:

for example like this :


Is this a feature we could add by contributing to the C9 SDK?

I came here to request this exact feature. I want it all the time. I would also like this to be in the context-menu that appears when right clicking on an open file tab.


sdk or init script can be used to implement this.

in init script it would look something like

var tree = services.tree;
var ui = services.ui;
var clipboard = services.clipboard;
tree.getElement("mnuCtxTree", function(mnuCtxTree) {
    ui.insertByIndex(mnuCtxTree, new ui.item({
        caption: "Copy file path",
        onclick: function() {
            var text = {
                return n.path;
            clipboard.clipboardData.setData("text/plain", text);
    }), 650, plugin);

var tabbehavior = services.tabbehavior;
var menus = services.menus;
tabbehavior.once("load", function() {
    menus.addItemByPath("Copy file path", new ui.item({
        onclick: function() {
            var text = tabbehavior.contextMenu.$tab.path;
            clipboard.clipboardData.setData("text/plain", text);
    }), 800, tabbehavior.contextMenu, plugin);


Nice, and with keyboard combination shortcut ? Is it available too ?

#12 adds a command which can be used with keyboard


Thank you! Any idea when it will be released? I don’t see it yet.


@justincy just saw this oldy but goody and noticed we never followed up on this (better late than never :grin:). This is now in place:

It’s also available to assign a keybinding to. This command is titled copyFilePath.