Run command in terminal from IntelliJ External Tools - intellij-idea

I want to run a command in the OSX terminal using the IntelliJ Idea External Tools. I don't want the command to run in the IntelliJ terminal.
This is what should happen when I run the tool:
The OSX terminal opens in a separate window
The command I want (with parameters) runs in the OSX terminal
The results of the command are displayed in the OSX terminal
The terminal is NOT closed afterwards
Is this possible?

This should be possible, however, I don't have a mac to test this on.
This is how you would do it in Windows. Maybe you can translate to the OSX equivalents.
Program cmd.exe
Parameters /c start "" cmd.exe /k dir
Working directory $FileDir$
cmd.exe is the terminal so substitute the OSX terminal command here.
/c passes commands to cmd.exe then exits
start "" cmd.exe is a Windows command to start an application "" means no title and cmd.exe says we are going to launch the command window again.
/k means do the command and then stay open
dir is the command I am doing (same as ls)
$FileDir$ is the IDEA macro for the the directory of the file you are clicking on. You can change this to other macros to what fits your need.

Related

How to use command prompt via vb.net to use BCDEDIT

I have a batch file which contains some commands with bcdedit.
but in my vb.net application when I run that batch file via: Process.Start("CMD", " /C \blahblah\test.bat") it says bcdedit is not recognized.
so what I've found so far is the cmd.exe that vb.net opens it doesn't recognize bcdedit command at all.

Git Bash prompt does not open - GIt bash installation

I have installed several times the package GI-1.9.4-preview20140611.exe on my Windows 8. When I try to open the git bash command window, the window opens, but it is empty, no showing the usual welcome message and the git prompt.
I have tried changing the command for the sh.exe file, which usually has the format
"sh.exe --login -i" into just "sh.exe". The shell opens then, the PS1 variable shows only the sh.exe file name and version, nothing more. Is there something wrong with my installation?
Thanks!
Your installation is fine.
The git executable(sh.exe) for Command Line Tool is a script that in order to work will be based on the your windows Command Prompt (cmd.exe)
You will need the following string to refer to Git correctly as an executable:
C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"
Or you can always 'right-click' and SELECT 'Git Bash Here' or 'Git GUI Here'

Invoke jar on remote windows machine using SSH

I'm using Bamboo as a CI (living on an AWS linux box) and have setup an SSH task where by I wish to invoke a jar file on another, physical, Windows machine. I have setup an SSH client on the Windows machine (Dameware SSH) and have setup a user called admin / admin.
The jar file runs a tool called SeInterpreter to run interpret .json selenium tests into webdriver tests.
I have a lack of knowledge around the format for the shell script I need to run in order to invoke the jar on the remote machine. I have cobbled the following together:
ssh admin#L-IS03159.nt.ad.local cmd /c cd /d "c:/SeInterpreterB11" cmd /c java -jar SeInterpreter.jar --driver=Remote --driver.browserName=firefox --driver.url=http://L-IS03159.nt.ad.local:4444/wd/hub/ C:/seleniumBuilderPOC/tests/loadHomePageSearchHomepage.json
The error from Bamboo is:
23-Jul-2014 15:36:12 Unable to execute command or shell on remote system: Failed to Execute process.
23-Jul-2014 15:36:12 Result: exit code = -1
23-Jul-2014 15:36:12 SSH command failed. Failing build.
Can anyone see obvious errors in the script syntax?
Your command line has the following form:
ssh user#hostname cmd /c [cd command] cmd /c [java command]
Try the following form, instead:
ssh user#hostname cmd /c "[cd command] && [java command]"
&& is a command separator in cmd.exe.
You may run into issues with the quotation marks in cd /d "c:/SeInterpreterB11". Since there are no spaces in this path, the quotes aren't necessary. Consider removing them to avoid headaches dealing with quote escaping.

In command line, putty remote shell doesn't work, but in GUI, it does work

Using the GUI putty.exe, I can connect to my windows server and once it is connected, i can type any command like rename file or mkdir folder and they all work
However, using command line such as
putty -load test -m C:\users\test.txt
or using the GUI putty, but add 1 command to remote command in SSH under Connection, then the command doesn't get executed.
Can anyone explain to me why this is happening or how can i fix this? I am using FreeSSHd on windows 2008 server.
Not sure if this helps, but try adding the /bin/bash directly after your command in the text file. It will keep the window open and you can see what the output of the shell would be if you ran it from the gui.
; /bin/bash
For example if test.txt is running a script
bash myscript.sh
bash myscript.sh; /bin/bash
This is assuming bash.

Is there a way to configure PuTTY or other terminal to flash the taskbar on next output to stdout?

I'm specifically looking for a solution for PuTTY but also interested for other terminal emulators, like Gnome Terminal.
My thought is it would be useful if I start a tar zxvf to be able to set a trigger on the terminal emulator, minimize it, and on next output to stdout/stderr I get a notification in the task bar that the command has finished.
This works for me:
echo -e "\a"
Then update your PuTTY session to use the Visual Bell, and set "Taskbar/caption indication on bell" to Flashing or Steady.
Then run this command after your tar completes:
tar xvzf file ; echo -e "\a"
Here is a screenshot: Save these settings as the default settings and/or the sessions' settings you have