jcjordyn140 / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Setting environment variables on commmand line #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Being able to set environment variables for the child process on the mintty
command line might be useful, because Windows shortcuts don't support them,
e.g.:

  mintty DISPLAY=:0 ssh server

Of course in shell this can be done already by prepending the variable
definition to tmintty, which passes its environment on to the child anyway:

  DISPLAY=:0 mintty ssh server

As a workaround for the shortcut issue one can either set a system-wide
Windows environment variable (hidden away somewhere in the "Computer"
properties), or create a batch file that sets the variable before invoking
mintty and have the shortcut point to that.

Original issue reported on code.google.com by andy.koppe on 13 Feb 2009 at 7:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by andy.koppe on 14 Mar 2009 at 8:51

GoogleCodeExporter commented 9 years ago
Actually, this will do:

mintty sh -c 'DISPLAY=:0 ssh server'

Original comment by andy.koppe on 14 Mar 2009 at 9:34

GoogleCodeExporter commented 9 years ago
Bash executes the -c command without forking a new process, so there's not much 
point
in MinTTY dabbling in shell functionality. This needs a TIP in the manual 
though.

Original comment by andy.koppe on 15 Mar 2009 at 6:51

GoogleCodeExporter commented 9 years ago
Added tip in r183.

Original comment by andy.koppe on 16 Mar 2009 at 12:31