Subject: bug#17231: [PATCH] term.el: unreliable directory tracking

From: Noam Postavsky <[email-masked]>
Date: Mon, 11 Dec 2017 20:37:35 -0500

So this has been sitting for a while...

Callum Cameron <[email-masked]> writes:

> The patch checks to see if there is an incomplete command at the end
> of term-emulate-terminal's input string, and, if so, saves it so the
> whole command can be processed when the next string arrives. I'm a
> Lisp newbie, so I don't know if this is the best way to do it, and it
> isn't foolproof - if the command gets split in the 'AnSiT' magic, it
> won't get handled. But I've never seen this happen (I've only ever
> seen the trailing newline get split off), and I've been using it for a
> few weeks without problems, and without any noticeable slowdown.

The patch looks okay to me.  It's a bit unfortunate that it adds yet
another way to store partial strings; I have a patch which fixes things
in a more unified way, but my patch rewrites too much to go on the
release branch.

So I think it would be nice if this patch could go to emacs-26.  I
presume you don't have copyright assignment (so the patch should be
marked as a tiny change)?

> + (defvar term-partial-ansi-terminal-message nil "Keep partial ansi
> + terminal messages for future processing.")

And this newline in the middle of the docstring should be fixed.