From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Random832 Newsgroups: gmane.emacs.help Subject: Re: M-x term on Windows Date: Wed, 28 Oct 2015 10:40:47 -0400 Message-ID: <87oafjukcw.fsf@fastmail.com> References: <87vb9yi6n5.fsf@fastmail.com> <83io5yrqxk.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446043833 21335 80.91.229.3 (28 Oct 2015 14:50:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Oct 2015 14:50:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 28 15:50:23 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZrS3Q-0003g2-Kl for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Oct 2015 15:50:21 +0100 Original-Received: from localhost ([::1]:38493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrS3Q-0000wL-5g for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Oct 2015 10:50:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrRuy-0003VZ-KC for help-gnu-emacs@gnu.org; Wed, 28 Oct 2015 10:41:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrRuv-0005BT-Pv for help-gnu-emacs@gnu.org; Wed, 28 Oct 2015 10:41:36 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:53026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrRuv-0005BJ-Gx for help-gnu-emacs@gnu.org; Wed, 28 Oct 2015 10:41:33 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZrRup-0005eR-0p for help-gnu-emacs@gnu.org; Wed, 28 Oct 2015 15:41:27 +0100 Original-Received: from c-68-39-146-59.hsd1.in.comcast.net ([68.39.146.59]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Oct 2015 15:41:22 +0100 Original-Received: from random832 by c-68-39-146-59.hsd1.in.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Oct 2015 15:41:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-68-39-146-59.hsd1.in.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:Dco2DP8M19Ke8z8maqCYa0cP6Hk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107865 Archived-At: Eli Zaretskii writes: > term.el in its present form cannot be run on MS-Windows. It has too > much staff hardcoded that assumes a Posix shell in /bin/sh and a > terminal driver that supports Posix features like stty settings and > SGR escape sequences. SGR escape sequences have nothing to do with the terminal driver, they are provided by emacs itself. Did you mean the expectation that the programs running inside it will emit them? I thought this was implicit in my statement that I was going to use it for ssh (to a GNU/Linux machine). I have made some progress... as far as I can tell, the assumption is mostly isolated to the start-process call site itself, and simply ripping it out and having it start plink directly (I currently have a hardcoded path and am ignoring the user-entered command - this isn't nearly ready to submit a patch) works fine. The key factor that makes it work for this use case is that the stty settings are mostly all handled by the remote host - plink just shovels a stream of bytes back and forth. Unlike git (MSYS?) openssh, it doesn't care if its own standard I/O streams are pipes and is willing to open a remote pty regardless. The other annoyance I have run into is that I have to run the "resize" command (supplied with xterm) manually - once at login and then after any change, to detect the window size. I couldn't find anywhere in the code to react to changes (e.g. by calling stty rows/cols again), and there aren't any hooks in plink to handle this anyway. The environment variables such as TERM also aren't propagated to the remote host, but that seems to be plink's fault. > Plink is a native Windows program, so it doesn't need 'term'. You > should be able to run it from "M-x shell". But M-x shell can't handle escape sequences.