help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On Windows(R) Emacs «shell» mode doesn't prints an output.


From: Pascal J. Bourguignon
Subject: Re: On Windows(R) Emacs «shell» mode doesn't prints an output.
Date: Thu, 25 Sep 2014 08:32:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi-Angel <address@hidden> writes:

> When I am working on Windows, I am using Emacs «shell» mode. The
> problem is that it sometimes doesn't prints an applications output
> (more precisely prints only after the app died).
> The problem is present exclusively in Emacs, e.g. if I am run an
> application in Windows® native terminal, it is works fine.
>
> I thought that the problem is in encoding, and set «shell»'s buffer
> with «C-x <RET> f» to UTF-16, which, as I know, uses MS, but it didn't
> fixed the problem.

1- this is not an emacs problem.

2- this is a basic programming question, that dates back since the dawn
   of computing.

3- what the fuck are you taught in school?


> Below is a simple example of an application that won't print an output in 
> Emacs:
>
> #include <cstdio>
> #include <cstring>
>
> int main(){
>     puts("Hello, enter something");
>     char buf[256];
>     memset(buf, 0, sizeof(buf));
>     fgets(buf, sizeof(buf)-1, stdin);
>     puts(buf);
>     return 0;
> }
>
> This works fine in both GNU/Linux, and the terminal of Windows®, 

By pure chance.

> but not in Emacs shell mode on Windowsor.


YOU FORGOT TO FLUSH YOUR BUFFERS!

man 3 fflush

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


reply via email to

[Prev in Thread] Current Thread [Next in Thread]