Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cygwin bash does not display correctly in emacs shell

Tags:

I'm trying cygwin with emacs. My environment is Windows 7 x64, emacs-24.0.93.1, cygwin 2.769, system encoding is gbk, cygwin's coding system is default to utf-8, and emacs's coding system is default to gbk

I use setup-cygwin to setup cygwin with emacs. And I can launch emacs shell using cygwin bash.But I encountered two problem. First, two warnings at the beginning of bash

bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell 

Second, after bash response, some strange characters appeared. enter image description here

Does anyone know what happened?

like image 900
jiluo Avatar asked Mar 12 '12 15:03

jiluo


People also ask

How do I use Emacs in Cygwin?

Install Emacs for Cygwin. Run the apropriate setup tool (as mentioned at https://cygwin.com/install.html) and select the Emacs package that you'd like to install. If you haven't installed Emacs before in Cygwin, choose "Not Installed" from the "View" and search for "emacs". Thanks.

What is Cygwin bash?

description: Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003. 2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use.


2 Answers

A "known problem," with no known solution (yet):

https://www.emacswiki.org/emacs/NTEmacsWithCygwin#toc2

https://sourceware.org/ml/cygwin/2012-03/msg00347.html

like image 163
23emacs Avatar answered Oct 03 '22 16:10

23emacs


Add this to your init:

(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) 

As for your other message, I've started getting that myself only recently. I've run emacs/cygwin/bash for a while, and I'm not sure yet what caused it.

like image 37
harpo Avatar answered Oct 03 '22 16:10

harpo