Resizing problem

Ken Brown
Fri Jul 16 02:04:00 GMT 2010

On 7/15/2010 9:26 PM, Olwe Melwasul wrote:
> On Thu, Jul 15, 2010 at 4:20 PM, Ken Brown<>  wrote:
>> On 7/15/2010 3:51 PM, Olwe Melwasul wrote:
>>> Yes, I am using the emacs-X11 and yes, I started it (after starting
>>> the X server to get multiwindowed mode) with ">emacs&" at the cygwin
>>> command. Emacs-X11 comes up fine, looking good. Then I do "M-x shell"
>>> to get a shell environment inside of Emacs. But what comes up is not
>>> bash. I'm not sure what it is, but it sees no cygwin apps: It doesn't
>>> know what "ls" or "which diff" or any other GNU/cygwin stuff is. I
>>> assume it is the DOS shell. Oddly, if I start emacs-X11 inside the
>>> windowed mode (startx) and do emacs shell mode, it does see bash and
>>> the rest of the GNU/cygwin apps.
>> [Please don't top-post.]
>> I think the problem is that your PATH isn't set correctly inside emacs.  How
>> are you starting the X server?  If you use the start menu shortcut (with
>> target C:\cygwin\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin.exe)
>> you shouldn't have that problem.  Notice that it uses 'bash -l' precisely so
>> that the environment, including PATH, is set up in the normal way.
>> Ken
> I started the X-server with the menu shortcut (which has the execute
> string you listed) and ... after ... a full minute it delivers a
> stand-alone xterm. I then click on the Emacs-X11, and after a long

It sounds like you're using the Emacs-X11 start menu shortcut that's 
created by the X-start-menu-icons package.  Don't use it.  It doesn't 
set up the environment properly before starting emacs.  To get a useful 
shortcut, you can use the script /usr/bin/make-emacs-shortcut that comes 
with the emacs package.

> wait, it comes up. I do an M-x shell -- and get a "sh-3.2$" prompt. I
> try some commands, and it only seems to know a few. "cd" does get me
> to "/home/Olwe" which tells me it must have something to do with
> cygwin, but it knows no other GNU/cygwin other than perhaps "pwd".
> Next, I kill it and start Emacs-X11 in the xterm "emacs&". It comes
> up fine. I do M-x shell -- and get the identical prompt I got in
> xterm, namely,
> Olwe@Olwe-PC
> $
> I type commands and they work -- it sees the GNU/cygwin apps fine --
> but it leaves odd characters after it returns, e.g.
> $ which diff
> /usr/bin/diff
> ^[]0;~^G

This is ugly but harmless.  It's an escape sequence that's part of the 
shell prompt, which is controlled by the PS1 environment variable.  (In 
a normal shell, as opposed to one in emacs, you don't see it directly; I 
think it affects the color of the current directory, displayed as part 
of the prompt.)

> The last string is not random, it has some method to its madness. For example
> $ ls
> dbus-4xiZFwCMPa  dbus-U6vB5c6MSd  dbus-hdtwMyVbXA  dbus-yXQ8LOSIN3
> ]0;/tmp
> Actually, I copied the above output and lost the ^[ and the ^G, but
> they show up on the emacs shell output.
> Next, I kill emacs-X11 stand-alone and start emacs -nw in the xterm.
> Same funky characters. I try other consoles -- same funky characters.
> Again, the windowed mode doesn't have these problems, just the issues
> with minimized apps disappearing beyond the bottom of Openbox.
> If I could just get rid of the funky xterm characters, I'd call it a day....

Read about the PS1 environment variable in the bash manual (or google).


Unsubscribe info:
Problem reports:

More information about the Cygwin-xfree mailing list