views:

220

answers:

2

Hi so, I've been having a lot of problems with emacs and trying to get the terminal to work with:

    M-x term

I installed cygwin and I fixed up my .emacs to include the paths:

    (setenv "PATH" (concat "c:/cygwin/bin;" (getenv "PATH")))
    (setq exec-path (cons "c:/cygwin/bin" exec-path))
    (require 'cygwin-mount)
    (cygwin-mount-activate)
    (add-hook 'comint-output-filter-functions
    'shell-strip-ctrl-m nil t)
    (add-hook 'comint-output-filter-functions
    'comint-watch-for-password-prompt nil t)
    (setq explicit-shell-file-name "bash.exe")
    ;; For subprocesses invoked via the shell
    ;; (e.g., "shell -c command")
    (setq shell-file-name explicit-shell-file-name)

However now when I launch terminal, it seems to give nothing but a blank screen and "hang"

When I launch:

    M-x shell

It does indeed launch the bash shell and flying around the file directories is okay (with cd, ls, cp, rm, etc.). However, when I do something like try to open up a Python shell, it again hands, and I type in ... and the shell crashes. Is there anything significantly wrong with what I am doing or perhaps somebody could direct me towards solutions online? (I've looked quite extensively.)

SSH also gives the error:

"Pseudo-terminal will not be allocated because stdin is not a terminal."

+3  A: 

Are you using the default 'Cygwin Bash Shell'? This is the one that launches inside a Windows cmd shell, and you can't drag to resize the screen. This shell is horribly broken, because of the underlying Windows component. Try using something like rxvt, or one of the putty forks.

If this is all set, then the issue is likely a termcap issue. Some people set their Cygwin TERM variable to 'xterm', because many remote machines don't have termcaps installed for things like rxvt-cygwin-native. Overridding it locally will cause problems with programs that attempt a range of terminal operations.

In your ~/.bash_profile, you can set your terminal to the following. export TERM=rxvt-cygwin-native

See my rxvt install guide and tips for more on rxvt.

brianegge
Having trouble setting up rxvt through .emacs...saying '-i is not an option' and lists possible options. What is the default setting for the TERM variable? I found sources online saying it's set to CYGWIN, however, I don't know if this is the batch file or some other hidden file? Hard to get a shell in emacs, I guess. Thanks a lot for the input though!
mduvall
A: 

Have you tried launching Emacs from a Cygwin shell, and then using Emacs as normal?

Trey Jackson
Do you mean the cygwin version of emacs or the win32 native?Seems like the cygwin version is the best if you're using cygwin, whilst a combination of the win32 native and Gnuutils is much more solid windows experience IMHOhttp://ftp.gnu.org/pub/gnu/emacs/windows/http://gnuwin32.sourceforge.net/
justinhj
I use the win32 native version of emacs, but start it from a cygwin shell.
Trey Jackson