Trying to get a terminal to work in Emacs

I had a lot of problems with emacs and trying to get the terminal to work:

    M-x term

I installed cygwin and I fixed 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 start the terminal, it seems to be giving nothing but a blank screen and is “freezing”

When I run:

    M-x shell

It really starts the bash shell and flies around the file directories in order (with cd, ls, cp, rm, etc.). However, when I do something like trying to open a Python shell, it fails again, and I enter ... and the shell fails. Is there anything significant in what I'm doing, or can someone direct me to online solutions? (I looked pretty wide.)

SSH also gives an error:

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

+3
2

"Cygwin Bash Shell"? , Windows cmd, , . - Windows. - rxvt -.

, , , termcap. Cygwin TERM "xterm", , rxvt-cygwin-native. , .

~/.bash_profile . export TERM=rxvt-cygwin-native

. rxvt rxvt.

+3

SSH :

" , stdin ".

NTEmacs ( cygwin emacs), :

  • cygwin gcc
  • fakecygpty.c fakecygpty.exe
  • fakecygpty ssh my_server ssh my_server emacs ( , fakecygpty ).

*shell* cmd, cygwin bash git bash, . , fakecygpty.c NTEmacs cygwin tty, ssh . fakecygpty SSH ntemacs.


NTEmacs SSH, init.el:

(eval-after-load "tramp"
  '(progn
     (add-to-list 'tramp-methods
                  (mapcar
                   (lambda (x)
                     (cond
                      ((equal x "sshx") "cygssh")
                      ((eq (car x) 'tramp-login-program) (list 'tramp-login-program "fakecygpty ssh"))
                      (t x)))
                   (assoc "sshx" tramp-methods)))
     (setq tramp-default-method "cygssh")))

Tramp 2.2.7, ssh ntemacs.

, - .:)

+1

Source: https://habr.com/ru/post/1723752/


All Articles