I've been dealing with this for some time - the mintty console is not a
real windows' console
but something else , bleh bleh ...
\
What I do now is set up another CMD.exe shortcut which has the target,
<path>\msys32\usr\bin bash -login -i
and Start in: <path>\msys32\usr\bin .  The command-line behavior is
excellent, and it runs through the /etc/profile (with MSYSTEM not set) as
well as .bashrc in the home directory.

To run my mingw programs I source a shell that sets the path to what is
needed, "run32" or "run64" which for this
window is a bit more elaborate than the path I use to build:

> $ echo $PATH
>
>
>> /usr/local/bin:/usr/bin:/bin:/c/Windows:/c/Windows/system32:/c/Windows/system32/Wbem:/usr/bin/site
>
> erl:/usr/bin/vendor_perl:/usr/bin/core_perl
>
>
>> greg@Homerw7  ~
>
> $ cat run32
>
> if [[ -v MSYS2_PATH ]] ; then
>
>   if [ "x${MSYSTEM}" = "x" ] || [ "x${MSYSTEM}" = "xMSYS" ] ; then
>
>         PATH="/c/usr/bin32:/c/usr/bin32/mingw:/c/usr/lib32:"
>
>   export PATH=$PATH"/mingw32/bin:/opt32/bin:${MSYS2_PATH}:${wpath}"
>
>
>>         fi
>
> else
>
>   export PATH="/mingw32/bin:/opt32/bin:${MSYS2_PATH}:${wpath}"
>
> fi
>
> #
>
> # gdls is associative array (capital A)
>
> # ${array[index]} gets value
>
> # ${!array[*]} list of keys.
>
> #
>
> unset gdls; declare -A gdls
>
>      gdls=([gdl32]=/d/bld/gdl32/bin/gdl \
>
>         [gdltst32]=/d/bld/gdl/mingw32c/src/gdl \
>
>         [gdlgvj]=/d/bld/gdl/mingw32-gvj/src/gdl \
>
>         [gdlplgit]=/d/bld/gdl/mingw32-plgit/src/gdl \
>
>         [gdlbasic]=/d/bld/gdl/mingw32-basic/src/gdl \
>
>         [gdlstatic]=/d/bld/gdl/mingw32-static/src/gdl \
>
>         [gdlwidgets]=/d/bld/gdl/mingw32-wxwidgets/src/gdl)
>
> for name in ${!gdls[*]}; do
>
>   if [[ -f ${gdls[$name]} ]] ; then
>
>      echo `date -r ${gdls[$name]}` ${gdls[$name]} \<$name\>
>
>      alias $name=${gdls[$name]}
>
>   else
>
>      unalias $name
>
>   fi
>
> done
>
> unset gdls
>
>
On Wed, Jan 13, 2016 at 6:14 AM, Andrew Lowe <[email protected]> wrote:

> On 13/01/2016 9:48 PM, David Macek wrote:
> > On 13. 1. 2016 12:47, Andrew Lowe wrote:
> >> On 13/01/2016 7:08 PM, Paul Moore wrote:
> >>> On 13 January 2016 at 10:57, Andrew Lowe <[email protected]> wrote:
> >>>> /* * Activity Name:
> >> [snip]
> >>
> >>>> -----------------------------
> >>>>
> >>>> I've compiled this using the latest, as of a week ago, versions
> >>>> of both clang and gcc and the behaviour is the same.
> >>>
> >>> This appears to be a buffering issue. When you write to stdout,
> >>> the data is buffered. You could try adding a fflush(stdout) just
> >>> before your scanf call. See
> >>>
> http://stackoverflow.com/questions/3723795/is-stdout-line-buffered-unbuffered-or-indeterminate-by-default
> >>>
> >>>
> >>
> >>>
> for a discussion.
> >>>
> >>> Paul
> >>>
> >> Thanks for the thought but that's not going to work. I can't go
> >> placing more road blocks in front of the students. It's hard enough
> >> as it is to get them to do/understand what's going on without
> >> adding fflush() to the mix.
> >>
> >> I just need the same behaviour as cmd.exe and bash under Linux. Is
> >> there something in Mintty/bash that I can "turn on/off"?
> >
> > See either <https://code.google.com/p/mintty/issues/detail?id=218> or
> > <https://github.com/mintty/mintty/issues/218>.
> >
> > The proposed `winpty ./a.exe` works.
>
> See my just previous comment
>
> >
> > I googled for a way to disable output buffering without changing the
> > program code and only idea that showed some promise was a DLL
> > injector that would automatically hook all child processes of mintty
> > and call `fflush` (periodically) or `setvbuf` (at the right moment
> > after stream set-up) on their behalf.
> >
>
>         I had a look at the mintty bug you referenced and that offers a
> glimmer
> of hope. I have placed the line in my app and it fixes the problem. I
> have had the students create a template file, which was basically my
> original example code without the printf() and scanf() which sits in the
> root of their work dir. Whenever they start a new app, they create it
> from this template, "cp ../template.c assign04.c". I can place the call
> to setvbuf() in the template and tell the students it has to be there
> and DON'T TOUCH.
>
>         I usually use Linux or the "graphical" front end of Windows so I'm
> still finding my feet with this "Command line stuff under Windows" type
> of thing. Is ConEmu similar to mintty? If it is, is it worth my while
> trying to see if it solves the problem?
>
>         Regards,
>                 Andrew
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Msys2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/msys2-users
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to