Add ‘Open in Terminal’ to Pantheon Context menu in Elementary OS

August 30, 2013 — 10 Comments

Are you using the Elementary OS instead of Ubuntu? Well, here I’ll show you how to add the ‘Open in terminal’ option to the Pantheon file manager right-click menu. So that you can quickly open terminal and automatically navigate to the current directory in Pantheon.

open in terminal for pantheon

To get started, use your favorite editor to create the config file /usr/share/contractor/openinterminal.contract and edit it. I prefer Gedit, so I install it and edit the file via below commands:

sudo apt-get install gedit

sudo gedit /usr/share/contractor/openinterminal.contract

Copy and paste below lines into the file and save it.

[Contractor Entry]
Name=Open in terminal
Icon=terminal
Description=Open in terminal
MimeType=inode;application/x-sh;application/x-executable;
Exec=pantheon-terminal -d %U
Gettext-Domain=pantheon-terminal

Log out and back in and done! Or you need a restart if it doesn’t work properly.

I'm a freelance blogger who started using Ubuntu 5+ years ago and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me on Google Plus or email to ubuntuhandbook1@gmail.com

10 responses to Add ‘Open in Terminal’ to Pantheon Context menu in Elementary OS

  1. I do that, And always Open terminal in my home directory instead where I am, Then I check out in terminal use the script to open a directory :
    pantheon-terminal -d /dir/to/go
    and nothing , always open a terminal in Home Directory. I will find another solution thanks for the help is something :D

  2. Hey,I try with sudo pantheon-terminal -d /my/dir/to/go and Run perfect !
    But doesn’t work without sudo, I just thought It never work for me, thus I open a directory and click in Open in terminal then works fine :D Really I don’t know what happens but now it work perfectly :D thanks budy!

  3. It’s not working for me. I just opens the ~/ dir

  4. Hi everyone,

    I’ve just solved this problem installing xfce4-terminal and modifying some lines:

    [Contractor Entry]
    Name=Open in terminal
    Icon=terminal
    Description=Open in terminal
    MimeType=inode;application/x-sh;application/x-executable;
    Exec=xfce4-terminal --working-directory %U
    Gettext-Domain=xfce4-terminal

    Thanks for share ;)

    • Hi guys,

      I just solved the current folder opening problem

      use -w (working directory) istead if -d

      [Contractor Entry]
      Name=Open in terminal
      Icon=terminal
      Description=Open in terminal
      MimeType=inode;application/x-sh;application/x-executable;
      Exec=pantheon-terminal -w %U
      Gettext-Domain=pantheon-terminal

  5. i tried to make this work with terminator but nothing happend
    this is my contractor
    [Contractor Entry]
    Name=Open in terminal
    Icon=terminator
    Description=Open in terminal
    MimeType=inode;application/x-sh;application/x-executable;
    Exec=terminator -w %U
    Gettext-Domain=terminator

    what am i doing wrong? if someone can help thanks

Leave a Reply

*

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>