all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Keller <psilord@cs.wisc.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: emacs and screen
Date: Thu, 7 Apr 2011 19:55:01 +0000 (UTC)	[thread overview]
Message-ID: <inl4ql$7sn$1@dont-email.me> (raw)
In-Reply-To: b439lugxat.fsf@news.eternal-september.org

Richard Riley <rileyrg@googlemail.com> wrote:
> Peter Keller <psilord@cs.wisc.edu> writes:
> 
>> Hello,
>>
>> Using emacs 22.3.1 with screen version 4.00.03jw4 (FAU) 2-May-06 on a
>> debian squeeze box, I have run into a problem.
>>
>> When running emacs -nw, not in a screen session, C-x C-<left/right>
>> rotates me between buffers. When running in screen, only C-x
>> <left/right> will rotate me between buffers. Having to lift up on the
>> control key to use the arrows is *very* annoying when rapidly moving
>> between buffers.
>>
>> How can I fix this problem so under screen the C-x C-<left/right>
>> key combination works again? I have looked into both manuals, but
>> emacs should see the right key use, and screen doesn't make mention
>> that it messes about with C-x (well, without the escape sequence
>> being infront if it at any rate.)
>>
>> Thank you.
> 
> When going through a "minimalist" phase a year ago, I too used emacs -nw
> in screen and/or tmux.

I'm not so much in a minimalist phase as someone I hack with likes
to pair program over an emacs -nw session in a screen on a machine
to which are are both ssh'd.

> It's all down to termcaps and TERM setting and how emacs uses them.

So, the quick and dirty problem (after debugging for a while) is that
screen, by default sets the TERM env var in shells inside of screen to
"screen". Emacs gets upset at this.

If you start screen like 'screen -T xterm', then the TERM variable
for all shells created in the screen is 'xterm' and emacs functions
properly with respect to C-x C-<left/right>. This makes me very happy.

I tried setting 'term xterm' in the .screenrc, but it didn't seem to
work, so a bash alias of "alias screen='screen -T xterm'" is sufficient
for me.

> I can only say : impossibly complicated and oodles of hackish
> workarounds exists that require a lifetime of study to even begin to
> understand.

Yeah, having lived in unix all my life, that is shockingly true.
Unix terminals are like the field of Chemistry. All full of exceptions,
but that's the way the world is. You just memorize it.

> I went back to emacs on X and haven't looked back ;)

I use emacs on X in most or all other contexts. Sometimes an emacs
-nw is pretty useful though...

> On a more serious note, I sometimes uses emacs -nw still over ssh in a
> screen but frequently key combos fail - most noticeably any Fn keys and
> arrow keys,

Maybe my solution will help you, a lot of other stuff just started
working once I told screen what term it should provide to the shells
started in it.

Thank all of you for the help in this thread. My problem is now solved.

-pete








  reply	other threads:[~2011-04-07 19:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06 20:25 emacs and screen Peter Keller
2011-04-07  2:20 ` Javier
2011-04-07  4:11   ` Peter Keller
2011-04-07 10:28     ` Valentin Plechinger
     [not found]     ` <mailman.5.1302172224.24221.help-gnu-emacs@gnu.org>
2011-04-07 16:33       ` Peter Keller
2011-04-07 10:39 ` Richard Riley
2011-04-07 19:55   ` Peter Keller [this message]
2011-04-08 14:49     ` Lake Shore Dr
2011-04-08 15:07       ` Peter Keller
2011-04-11  5:57         ` Jonathan Groll
2011-04-11 13:25           ` Teemu Likonen
     [not found]         ` <mailman.2.1302501432.8606.help-gnu-emacs@gnu.org>
2011-04-11  6:00           ` Peter Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='inl4ql$7sn$1@dont-email.me' \
    --to=psilord@cs.wisc.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.