From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.bugs Subject: Re: Latin1 language environment breaks Cygwin shell buffer Date: Sat, 30 Mar 2002 21:10:10 +0300 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <9791-Sat30Mar2002211010+0300-eliz@is.elta.co.il> References: <877knurp7c.fsf@blarg.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1017512121 16096 127.0.0.1 (30 Mar 2002 18:15:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 30 Mar 2002 18:15:21 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16rNNo-0004BV-00 for ; Sat, 30 Mar 2002 19:15:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16rNNl-0005Je-00; Sat, 30 Mar 2002 13:15:17 -0500 Original-Received: from freya.inter.net.il ([192.114.186.14]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16rNMs-0005A4-00 for ; Sat, 30 Mar 2002 13:14:23 -0500 Original-Received: from zaretsky (diup-219-133.inter.net.il [213.8.219.133]) by freya.inter.net.il (Mirapoint Messaging Server MOS 2.9.3.2) with ESMTP id BHJ82522; Sat, 30 Mar 2002 21:14:13 +0300 (IDT) Original-To: offby1@blarg.net X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 In-Reply-To: <877knurp7c.fsf@blarg.net> (message from Eric Hanchrow on 30 Mar 2002 08:32:39 -0800) Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:311 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:311 > From: Eric Hanchrow > Date: 30 Mar 2002 08:32:39 -0800 > > On a Cygwin system (excruciatingly painful details below), type > `runemacs' at the shell, and then evaluate these four forms in order > (adjust the name of the "bash" program as needed for your system): I don't have Cygwin installed, so I can only speculate about this. Therefore, please take what's below with a grain of salt. > (set-language-environment "Latin-1") > > (setq shell-file-name "c:/cygwin/bin/bash") > (setq explicit-shell-file-name "c:/cygwin/bin/bash") You should probably use an explicit .exe extension in setting these variables. (Actually, I don't recommend setting these variables at all in Emacs, but instead set up PATH and SHELL variables _outside_ Emacs so that the right shell is found. But this is a different issue, probably unrelated to your problems.) > (shell) > > You will, not surprisingly, see a "*shell*" buffer appear. Now switch > to that buffer with C-x o, and hit the Enter key -- you'll see > > $ > : command not found > > (You'll also see a lot of cruft from escape sequences in the Bash > prompt; you may ignore those) I rather think that this ``cruft'' should not be ignored, but instead closely scrutinized. I suspect that, in a Latin-1 environment, Emacs finds in that cruft something that utterly confuses the shell mode. How about if you disable all the prompt rigamarole in your Bash, and see if that helps? Also, what about your settings of process-coding-system? What is it in both language environments you used, and does it help to use set-buffer-process-coding-system in the shell buffer so that Emacs decodes Bash output with undecided-dos? > I expected my choice of language environment to have no effect on the > functioning of the shell. The language environment sets the defaults for decoding subprocess I/O, so there are valid reasons you should assume it does in fact have effect on the interaction between Bash and the shell buffer. > I think that the shell is "seeing" a carriage-return at the end of the > input line, and complaining about it It is (or, rather, should be) normal for the Cygwin Bash to see a CR-LF pair at the end of each line. It shouldn't complain about it, but should rather DTRT: remove the CR and act on the rest as a normal text line. You might wish to experiment with mounting your filesystems in binary (instead of text) mode.