Accepting standard input from MSYS with native Win32 programs

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Accepting standard input from MSYS with native Win32 programs

John Pye
Hi all

I understand that there are some fundamental design issues with rxvt
and/or bash that means that MSYS can't be used as a command line from
running normal Windows/DOS console-based programs such as 'svn' when
input from stdin is required. As I understand it, it is because RXVT
expects programs to provide a 'TTY' interface, which is not compatible
with the way that native Windows/DOS programs do their I/O.

Native Windows command-line programs that I would like to be able to run
from MSYS would include python, svn, and other little programs that I
write in C.

I just wondered -- are there are any little hacks or workarounds that
can fix this situation? I am correct in my understanding about this problem?

Cheers
JP


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accepting standard input from MSYS with native Win32 programs

Earnie Boyd

Quoting John Pye <[hidden email]>:

> Hi all
>
> I understand that there are some fundamental design issues with rxvt
> and/or bash that means that MSYS can't be used as a command line from
> running normal Windows/DOS console-based programs such as 'svn' when
> input from stdin is required. As I understand it, it is because RXVT
> expects programs to provide a 'TTY' interface, which is not compatible
> with the way that native Windows/DOS programs do their I/O.
>
> Native Windows command-line programs that I would like to be able to run
> from MSYS would include python, svn, and other little programs that I
> write in C.
>
> I just wondered -- are there are any little hacks or workarounds that
> can fix this situation? I am correct in my understanding about this problem?
>

The real problem is that STDIN/OUT/ERR are pipes and there is no other
emulation that can be done.

For these programs I like to ``start /msys.bat --norxvt''.

Earnie

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accepting standard input from MSYS with native Win32 programs

Keith Marshall
On Thursday 11 September 2008 16:32:08 Earnie Boyd wrote:

<groan> Not this old chestnut *again*...

> Quoting John Pye <[hidden email]>:
> > I understand that there are some fundamental design issues with
> > rxvt and/or bash that means that MSYS can't be used as a command
> > line from running normal Windows/DOS console-based programs such
> > as 'svn' when input from stdin is required. As I understand it,
> > it is because RXVT expects programs to provide a 'TTY' interface,
> > which is not compatible with the way that native Windows/DOS
> > programs do their I/O.
> >
> > Native Windows command-line programs that I would like to be able
> > to run from MSYS would include python, svn, and other little
> > programs that I write in C.
> >
> > I just wondered -- are there are any little hacks or workarounds
> > that can fix this situation? I am correct in my understanding
> > about this problem?
>
> The real problem is that STDIN/OUT/ERR are pipes and there is no
> other emulation that can be done.

Yes, this is true when you insist on running your MSYS shell within
rxvt, the pipes are connecting rxvt to your application.  It isn't
the case when you run in a genuine native Win32 console.  You don't
have to run the MSYS shell in an rxvt; run it native, and you get
console I/O the way it's meant to be -- problem solved.

> For these programs I like to ``start /msys.bat --norxvt''.

Or just kick rxvt into touch -- permanently.  There are plenty of
references in the list archives, and on the old MinGWiki, telling you
the "little hacks and workarounds".  JFGI.  Search on "msys+console";
this takes me straight to the appropriate MinGWiki page.

Alternatively, if you really can't tolerate the bare native console,
even after following the advice given there, then have a look at the
Console-2 project on SourceForge:
 https://sourceforge.net/projects/console/

This gives you pretty much everything that rxvt does, and then some,
but it also behaves properly, wrt native console capabilities.  Try
it; it makes rxvt look positively mediocre.  It's just a shame it
can't be built with MinGW, (at least, without a lot of hacking).

Regards,
Keith.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accepting standard input from MSYS with native Win32 programs

John Pye
Hi Keith

Keith Marshall wrote:
> On Thursday 11 September 2008 16:32:08 Earnie Boyd wrote:
>
> <groan> Not this old chestnut *again*...
>  

Sorry if this is repetitive, it's just that rxvt is the standard thing,
and I've been introducing some new users to MSYS and this issue comes up
almost immediately as a frustration for them. I see that it is planned
to make the native console the default in the next MSYS release, so
let's look forward to that then.
http://www.mingw.org/MinGWiki/index.php/MsysShell

You said that Console (sf.net) provides 'pretty much' everything that
rxvt provides. What exactly are the shortcomings, if any? Are there
instructions somewhere on how to set Console as the default console for
MSYS?

Cheers
JP

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accepting standard input from MSYS with native Win32 programs

Keith Marshall
On Friday 12 September 2008 03:51:07 John Pye wrote:
> You said that Console (sf.net) provides 'pretty much' everything
> that rxvt provides. What exactly are the shortcomings, if any?

I'm not sure if you do actually lose anything.  At one time, IIRC,
*nix style job control, (with ^Z to suspend fg task), used to work
when running in rxvt, but not in native console; today, with bash
3.1.0, it doesn't appear to work in rxvt either.

I did find that some of the default key bindings for Console-2 were
badly chosen -- e.g. ^S bringing up the modal configuration dialogue
instead of being XOFF, or readline's incremental history search, or
info's incremental search.  There were others, less serious perhaps,
but which bugged me.  However, these can all be changed, and I've
done so, to suit my own preferences.

There is one feature I miss, when using the mouse to select text;
there is no double click to select an individual word, nor triple
click to select a whole line; the entire selection must be marked by
dragging.  Also, I notice that the highlight doesn't always move with
the selected text, when the display scrolls.

My only other gripe with it -- I'm using build 138 -- is that the
window background colour can't be set distinctively for different
shell tabs, (in spite of an apparent individual setting per tab), so
I've had to settle for just different tab icons and cursor styles, to
distinguish MinGW, MSYS and cmd.exe tabs.

> Are there instructions somewhere on how to set Console as the
> default console for MSYS?

No, and because it doesn't build with MinGW, I don't think we should
offer it as a default MSYS console.  However, IMO it offers such a
significant improvement in user experience over rxvt, or over the
native console, that I'm happy to recommend others to try it.

I've attached my own configuration preferences, which make it very
much like a KDE konsole; feel free to copy these, and tweak them to
your own preferences.

With this configuration, I don't even need to use msys.bat any more;
I simply have all the Console-2 files, (including the attached XML
configuration), in D:\opt\Console2, and a shortcut set to run

  D:\opt\Console2\console.exe

starting in my MSYS /bin directory

  D:\usr\MSYS-1.0.11\bin

with the start up mode set to `Normal window'.

Note that, in console.xml, I have the first tab class set up to run
the MSYS shell in its standard MinGW configuration, (making this the
default on start up), while the second tab class is set up for the
MSYS Developer mode, the third for cmd.exe, and the fourth for
Cygwin; I can create individual desktop shortcuts for each of these,
by adding a `-t <title>' option to the console.exe start up command,
where `<title>' matches the `title' property value for the desired
tab class, in console.xml.

HTH,
Keith.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

console.xml (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accepting standard input from MSYS with native Win32 programs

Paul Moore-2
Keith Marshall wrote:
> My only other gripe with it -- I'm using build 138 -- is that the
> window background colour can't be set distinctively for different
> shell tabs, (in spite of an apparent individual setting per tab), so
> I've had to settle for just different tab icons and cursor styles, to
> distinguish MinGW, MSYS and cmd.exe tabs.

Are you sure about that? I use build 139 (just upgraded to 140) and I
use different backgrounds per tab (you use the "Tabs" entry in the
configuration dialog - needs a restart to take effect). It may be I'm
misunderstanding what you want to do, though.

Paul.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accepting standard input from MSYS with native Win32 programs

Keith Marshall
On Friday 12 September 2008 21:37:01 Paul Moore wrote:

> > My only other gripe with it -- I'm using build 138 -- is that the
> > window background colour can't be set distinctively for different
> > shell tabs, (in spite of an apparent individual setting per tab),
> > so I've had to settle for just different tab icons and cursor
> > styles, to distinguish MinGW, MSYS and cmd.exe tabs.
>
> Are you sure about that? I use build 139 (just upgraded to 140) and
> I use different backgrounds per tab (you use the "Tabs" entry in
> the configuration dialog - needs a restart to take effect). It may
> be I'm misunderstanding what you want to do, though.

With build 138, (and with the earlier ones I've tried), I see barely
any effect for different background colour settings, in the "Tabs"
configuration dialogue.  The effect appears only as a narrow border,
in the designated colour, around the text panel.  This effect
vanishes entirely, if the border width is reduced to zero, (as I
prefer it).  This colour setting doesn't appear to affect the area
which I would describe as the background; I expect that to represent
the background colour over the entire text area of the tabbed panel.

Maybe this has been changed in build 139; I'll take a look on Monday,
(don't use MSW on my home boxes).

Thanks,
Keith.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Loading...