108

Do you know of any Eclipse plugin to run a system shell in the included console? It would be awesome. Dolphin, KDE's file navigator, has this feature, you can press F4 and a console shows located on the directory you are standing.

It would be awesome to have a similar feature on Eclipse, with the shell located on the directory of the project/file you are working on.

Does this plugin exist?

If not, would it be too complicated to code such a plugin? I have no idea about eclipse plugin development (yet).

Fernando Briano
  • 7,699
  • 13
  • 58
  • 75
  • 7
    The justification given to close this is INVALID. "*tend to attract opinionated answers and spam*" ?? This question is very specific, and would elicit only very specific answers. This is getting out of hand. – Blessed Geek Apr 26 '17 at 19:23
  • 1
    Yeah, I don't use Eclipse anymore, but it's a "Yes, here's one of them" kind of question. It doesn't ask which one is the best, or if it's a good practice. Also, the accepted answer is pretty specific. – Fernando Briano Apr 27 '17 at 22:03
  • Check out EasyShell https://github.com/anb0s/EasyShell it is very configurable. I use it with cmd and git bash on Windows. There is also https://marketplace.eclipse.org/content/tm-terminal if you want the shell to be a view in Eclipse, which works with cmd and git bash, etc. – successhawk Aug 04 '17 at 16:44

15 Answers15

97

It exists, and it's built into Eclipse! Go to the Remote Systems view, and you'll see an entry for "Local". Right-click "Local Shells" and choose "Launch Shell."

You can't launch it directly from the project navigator. But you can right-click in the navigator and choose "Show in Remote Systems view". From there you can right-click the parent folder and choose "Launch Shell."

Aptana also has a Terminal view, and a command to open the selected file in the terminal.

JW.
  • 50,691
  • 36
  • 115
  • 143
  • 43
    In case you haven't installed something that depends on it already, you will first have to do Install New Software -> General Purpose Tools -> Remote System Explorer End-User Runtime. – Glyph Apr 29 '10 at 23:06
  • 4
    Very rough indeed. I tried running sbt in such a view, and it crashed. – nfelger Jul 13 '11 at 19:16
  • Added note about Aptana. – JW. Oct 04 '12 at 20:55
  • I tried this solution but didn't work for me. If I right-click on 'Local Shells' and then select 'launch shell' this displays a so-called Remote Shell in Local. This shell actually does not response to commands (something I still don't understand). If instead of selecting 'launch shell' the option 'Commands>Shell Script>Open Terminal' is selected then a local terminal which actually works is displayed. – rauldg Mar 01 '13 at 09:09
  • 3
    Local shell is deprecated, the suggested default replacement is TCF Terminal (Console) View, under Mobile and Device Development support – Gerbrand Apr 14 '16 at 10:50
  • 3
    Just for reference since I was brand new to this: Go to Window->Show View->Other...->Remote Systems->Remote Systems to show the Remote Systems View – takanuva15 Dec 22 '17 at 19:46
  • 1
    This requires a plugin (the Remote System Explorer plugin from Eclipse Marketplace) that may or may not come with whatever install of Eclipse you have. – LightCC Dec 23 '18 at 23:56
  • There's a package *TM Terminal* that does the trick. After installing this one, there's a View *Terminal* available. – Bernhard Döbler Sep 18 '20 at 15:40
69

You don't need a plugin (including the Remote System View plugin), you can do this with the basic platform. You just create an external tool configuration. I've added an image to demonstrate.

screenshot from Mac of external tools configuration dialog with colored arrows

Orange Arrows: Use the external tool button on the toolbar and select External Tools Configuration.... Click on Program then up above click on the New launch configuration icon.

Green Arrows: Use the Name field and name your new tool something clever like "Launch Shell". In the Location area enter a shell command e.g. /bin/bash. A more generic approach would be to use ${env_var:SHELL} which under the Mac (and I hope Linux) launches the default shell. Then in the Working Directory you can use the variable ${project_loc} to set the default directory to your current project location. This will mean that when you launch the tool, you have to make sure you have your cursor in an active project on the explorer or in an appropriate editor window. Under the Arguments area use -i for interactive mode.

Blue arrows: Switch to the Build tab and uncheck Build before launch. Then switch to the Common tab and click to add your command to the favorites menu. Now click Apply and Close. Make sure the console view is showing (Window->Show View->Console). Click on a project in the Package or Project Explorer or click in an editor window that has code for a project of interest. Then click on the external tool icon and select Launch Shell, you now have an interactive shell window in the console view.

In the lower left of the image you can see the tcsh shell in action.

Windows Note: This also works in Windows but you use ${env_var:ComSpec} in the location field and you can leave the arguments field blank.

llrs
  • 3,308
  • 35
  • 68
Tod
  • 8,192
  • 5
  • 52
  • 93
  • Will that be external window? – Paul Verest Jan 27 '14 at 14:31
  • Found answer by @Andre, and combined into this one. – Paul Verest Jan 27 '14 at 14:42
  • 2
    No it opens the console window in the Eclipse console window. – Tod Jan 28 '14 at 01:30
  • I noticed you saw a similar answer below. I added comments to my edits explaining my thinking, but I thought I would post a direct answer to your question here in the comment. – Tod Jan 28 '14 at 08:21
  • I edited this answer adding a screenshot, but it is gone. Nevermind – Paul Verest Jan 28 '14 at 11:59
  • I am getting this error: bash: no job control in this shell – coolcool1994 Dec 13 '14 at 11:12
  • 5
    This is an elegant solution, but the session it creates is not fully functional. I get the following error messages: `bash: cannot set terminal process group (1893): Inappropriate ioctl for device` `bash: no job control in this shell` – Luís de Sousa Jun 15 '15 at 12:05
  • 1
    Another issue: the Tab does not function. – Luís de Sousa Jun 15 '15 at 12:08
  • 2
    I found that (at least under windows) using ${workspace_loc}\${project_name} works even when a simple file is selected in the navigator, while ${project_loc} gives me an error in that case. I'm using mintty (cygwin), it doesn't open in the eclipse console but I like it better than windows cmd ;) to make it work give this arguments instead of -i: "-e /bin/xhere /bin/bash.exe" – Antiphon0x Sep 18 '16 at 10:49
  • The `{project_loc}` is not working for me, I use `{container_loc}` instead which works better. – Ibrahim.H Feb 04 '21 at 08:44
57

Eclipse TCF team has just release terminal (SSH, Telnet, local)

originally named TCF Terminal, then renamed to TM Terminal

http://marketplace.eclipse.org/content/tcf-terminals

Finally Windows and Linux all supported

Support for Git Bash on Windows is resolved Bug 435014.

This plugin is included into Enide Studio 2014 and Enide 2015.

To access the terminal go to Window -> Show View -> Terminal or Ctrl+Alt+T

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • 3
    It needs some settings though...everytime I need to cd to the appropriate directory. – dalvarezmartinez1 Sep 19 '14 at 07:52
  • Wait for 1.3 released. If that would be not enough raise bug with request. – Paul Verest Dec 18 '14 at 02:45
  • At this day and age this is the only functional solution. Make sure you install the TM Terminal version **4.0**. – Luís de Sousa Jun 15 '15 at 13:27
  • I can't believe they nuked ability to right click a folder in Remote Systems and launch terminal. This is really undermines the usability. – Bostone Nov 13 '15 at 18:54
  • @Paul Verest, How did you changed the colore scheme of the terminal ? – Melad Basilius Dec 13 '17 at 14:02
  • @MeladEzzat see https://stackoverflow.com/questions/40459023/customize-theme-colors-of-eclipse-tm-terminal-plugin#43779152 – Stuart Cardall Oct 30 '18 at 11:47
  • has been renamed to `TM Terminal` – gkhaos Apr 15 '19 at 10:16
  • 1
    For having *TM Terminal* start *bash* with the current Eclipse user not having a login shell ("*This account is currently not available*"), I had to make the following configurations under Eclipse: *Preferences* → *Terminal* → *Local Terminal* → *Shell Command*: `/usr/bin/bash`; *Arguments* `-c bash`. – Abdull May 22 '23 at 07:05
12

Terminal plug-in for Eclipse provides a command line view (= INSIDE Eclipse), at the moment Linux and Mac OS X only, Windows is missing. For Windows, use JW's aproach.


(source: developerblogs.com)

Update 1:
They are working on Windows support, see this issue and a basic implementation.

Update 2: Not working on it since Aug 2013.

Community
  • 1
  • 1
ChrLipp
  • 15,526
  • 10
  • 75
  • 107
  • They are not working since August 2013. Quote from http://alexruiz.developerblogs.com/?p=2428 "Alex Ruiz August 3, 2013 at 12:49 pm Unfortunately I’m no longer maintaining this project, mostly due to a lack of spare time." – Paul Verest Jan 27 '14 at 14:03
  • 1
    From the solutions I've tried this worked best for me, thanks! – Dário May 06 '15 at 01:01
11

Add C:\Windows\System32\cmd.exe as an external tool. Once run, you can then access it via the normal eclipse console.

http://www.avajava.com/tutorials/lessons/how-do-i-open-a-windows-command-prompt-in-my-console.html


(source: avajava.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
André
  • 359
  • 1
  • 3
  • 8
5

Simply create a new external tool configuration (from Eclipse Run -> External Tools)

for example - To open Cygwin terminal on the current resource directory:

Location:

C:\cygwin\bin\mintty.exe

Working Directory:

${container_loc}

Arguments:

-i /Cygwin-Terminal.ico  
-"cygpath -p '${container_loc}' | xargs cd"
Noam Manos
  • 15,216
  • 3
  • 86
  • 85
Peter Hawkins
  • 373
  • 4
  • 7
  • you can also use ${env_var:ComSpec} as the program to execute, and add as arguments: /C start C:\cygwin64\bin\bash.exe --login -i, or omit the --login -i to start bash in the directory specified by eclipse – user1050755 Jun 13 '17 at 22:06
  • How can I open multiple, using this method? They all seem to pile into one console view. – Brad Dec 29 '17 at 19:51
4

I really like StartExplorer but it is a contextual launcher rather than in - IDE shell so not sure if that is what you want

reevesy
  • 3,452
  • 1
  • 26
  • 23
HaveAGuess
  • 1,231
  • 1
  • 13
  • 23
3

The best solution I have been able to find is TCF Terminals 1.2 (Luna).

You start off with a Windows command prompt. enter image description here

If you like git bash, you can get git bash going inside it like this: Eclipse with TCF Terminals 1.2 and running Git Bash The trick is the command:

D:\Apps\Git\bin\sh.exe --login -i

Change this command path to wherever you installed git. The arguments --login -i are key.

Sheparzo
  • 533
  • 6
  • 13
3

Aptana Studio 3 includes such terminal. I found it to be very similar to native terminal compared to what's mentioned in other answers.

fmjrey
  • 1,141
  • 1
  • 10
  • 16
2

I recommend EasyShell, which features 'open' (console), 'run', 'explore', and 'copy path'.

mar10
  • 14,320
  • 5
  • 39
  • 64
2

... just a little bit late :) you might give a try at http://code.google.com/p/tarlog-plugins/. It gives you options like open shell and open explorer from Project Explorer context menu.

There's also http://sourceforge.net/projects/explorerplugin/ but it seems kind of stuck at 2009.

superjos
  • 12,189
  • 6
  • 89
  • 134
2

You can also use the Termial view to ssh/telnet to your local machine. Doesn't have that funny input box for commands.

Tim P
  • 948
  • 1
  • 12
  • 19
1

In Eclipse 3.7, I found a terminal view plugin that I installed through Eclipse Marketplace. Details are as follow:

Local Terminal (Incubation) http://market.eclipsesource.com/yoxos/node/org.eclipse.tm.terminal.local.feature.group

A terminal emulation for local shells and external tools. Requires CDT Core 7.0 or later. Works on Linux, Solaris and Mac. Includes Source.

Side note, this terminal does not execute .bash_profile or .bashrc so you can do

source ~/.bash_profile

and (if this isn't sourced by `.bash_profile)

source ~/.bashrc

Update:

This is actually was base for Terminal plug-in for Eclipse fork. Quote from http://alexruiz.developerblogs.com/?p=2428

Uwe Stieber July 23, 2013 at 12:57 am

Alex, why not aiming for rejoining your work with the original TM Terminal? I’ve checked and haven’t found any bugzilla asking for missing features or pointing out bugs. There had been changes to the original Terminal control, so I’m not sure if all of your original reasons to clone it are still true.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
orluke
  • 2,041
  • 1
  • 17
  • 15
1

I wrote this to get a native shell...it uses the same GTK widget the gnome-terminal uses so the behavior should be nearly identical.

http://github.com/maihde/Eclipse-Terminal

Michael
  • 27
  • 1
0

I just found out about WickedShell, but it seems to work wrong with GNU/Linux and bash. Seems like some sort of encoding issue, all the characters in my prompt are displayed wrong.

Seems to be the best (only) tool for the job anyways, so I'll give it some more testing and see if it's good enough. I'll contact the developer anyways about this issue.

Fernando Briano
  • 7,699
  • 13
  • 58
  • 75
  • 1
    A warning: I installed wicked shell and started getting "Unexpected error" dialogs. So, If you get these also, just uninstall it. – xaav Aug 15 '11 at 03:23