Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Cygwin under Windows 7. How can I create a start menu entry (or desktop shortcut) to start xterm?

Currently, I have to start the Cygwin/X server, and each time I want a new xterm, I have to right click on the X server icon in the tray, and go to Applications->xterm, which is a pain. I tried to execute C:\cygwin\bin\xterm.exe after setting DISPLAY=:0.0. This brings up xterm, but gives a lot of errors on startup, and my environment (env variables, etc.) seems to be completely different from an xterm started up by using the X server tray icon.

share|improve this question
up vote 3 down vote accepted

You need to start a bash login shell in the new xterm as well:

mkshortcut -D -n xterm -a "xterm -display :0 -e /bin/bash -l" /usr/bin/run

This works for me.

share|improve this answer

Presuming you always use DISPLAY=:0, try the following:

mkshortcut -D -n xterm -a "xterm -display :0" /usr/bin/run

This will create a shortcut on your Desktop. Removing the -D flag will add the shortcut to the Start Menu toplevel instead. See man mkshortcut for more options.

share|improve this answer
Thanks, I didn't know about mkshortcut. However, if a create a shortcut the way you mentioned it, it starts xterm, but it doesn't seem to have the right environment: it refused to recognize my .bashrc file, and I can't even type ls (have to type /bin/ls instead). Do you know what's different between starting xterm this way and starting it through the Cygwin/X server? – PonyEars Jun 2 '13 at 8:29

The mkshortcut works, but the PATH is missing /usr/local/bin:/usr/bin: at its beginning. To solve it, you can either edit /etc/bashrc or ~/.bashrc and add the following at the end of the file:

share|improve this answer
Thanks, but while this might "fix" this particular problem, it creates other problems: /usr/local/bin:/usr/bin starts appearing multiple times in other instances of PATH (for eg, in xterm started from the X server icon, or from another xterm). If you could shed light on why this part of the PATH is missing when xterm is started via this shortcut, that might help find a solution. – PonyEars Dec 2 '14 at 22:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .