all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31605: 25.3; tramp-terminal-type too obscure
@ 2018-05-26 22:14 Eli Barzilay
  2018-05-29 11:19 ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Barzilay @ 2018-05-26 22:14 UTC (permalink / raw)
  To: 31605

This is mostly a documentation issue for tramp's info file.  The
problem is that `tramp-terminal-type` is described almost as an
afterthought in a section that talks about `tset` of all things...

It would be good to describe it better, and also mention it in the
section about zsh, since it's probably a very common problem there
with sophisticated prompts.

----

The thing is that the usual recommendation (included in the info too)
is:

    [ $TERM = "dumb" ] && unsetopt zle && PS1='$ '

For *years* I have not used tramp because I couldn't find a way to
make things work.  I ran into the zsh problem and coudln't find a
simple way that makes things just work: the above suffers from
affecting *all* dumb terminals, including running a shell inside of
Emacs too -- and while I don't use a right-prompt in Emacs, I don't
want to give up my useful prompt in the environment I most frequently
run my shells in!  It finally dawned on me that instead of doing the
above, I can hack tramp: find whatever function runs the command and
advice it somehow to see a different TERM setting -- but as I was
looking into doing that, I was surprised to find that
`tramp-terminal-type` already exists!  Using it, a much better
solution is to (setq tramp-terminal-type "tramp"), and in my .zshrc:

    [[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return

(Side note: since it's in zsh, it's better to use [[...]], and also
the wiki suggestion adding a `return` is useful since `.zshrc` is
intended for interactive configuration.)

In fact, I'd argue that the *default* value is better set as "tramp".
"dumb" is very overuse to provide some kind of interactivity that
tramp doesn't need anyway, so having a terminfo-unknown name like
"tramp" could only improve things for tramp uses.  But that will
likely break too many existing configurations (like ones that do the
above recommended zsh hack...), so maybe recommend it instead.

-- 
                   ((x=>x(x))(x=>x(x)))                  Eli Barzilay:
                   http://barzilay.org/                  Maze is Life!





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-05-30  7:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-26 22:14 bug#31605: 25.3; tramp-terminal-type too obscure Eli Barzilay
2018-05-29 11:19 ` Michael Albinus
2018-05-29 16:03   ` Eli Barzilay
2018-05-29 16:26     ` Michael Albinus
2018-05-29 16:39       ` Eli Barzilay
2018-05-29 17:46         ` Michael Albinus
2018-05-29 17:57           ` Eli Barzilay
2018-05-30  7:02             ` Michael Albinus
2018-05-30  7:10               ` Eli Barzilay

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.