From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: On Windows(R) Emacs =?iso-8859-1?Q?=ABshell=BB?= mode doesn't prints an output. Date: Thu, 25 Sep 2014 08:32:21 +0200 Organization: Informatimago Message-ID: <87wq8sus5m.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1411627225 28788 80.91.229.3 (25 Sep 2014 06:40:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2014 06:40:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 25 08:40:20 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XX2ix-0007nS-AJ for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2014 08:40:19 +0200 Original-Received: from localhost ([::1]:38373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XX2iw-0005JV-VZ for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2014 02:40:18 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-X-Trace: individual.net qmpw6LZfWI3armRZPXDyFwQApyARBilqyajGqvfvCPMZ8pR6wC Cancel-Lock: sha1:MjkyYTY0NzE1YTkyMTU4N2ZmZmUwNWI1NjBlZDQ3YmZkZTA2MzU4MA== sha1:hYvdUI4DFoTAALBfNgNRIYiSyS4= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:207858 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100133 Archived-At: Hi-Angel 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 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 > #include > > 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