Re: emacs and screen

From:

Lake Shore Dr

Subject:

Re: emacs and screen

Date:

Fri, 8 Apr 2011 14:49:56 +0000 (UTC)

User-agent:

tin/1.9.6-20100522 ("Lochruan") (UNIX) (Linux/2.6.32-5-686 (i686))

Congratulations. Screen is an application that is really worth making
it work. You just dettach/reattach your session at home/work/wherever
and never stop what you are doing.
Also, what were you writting in .screenrc? 'term xterm' or 'term "xterm"'
with double quotes? To me 'term "xterm"' gives the right value of the
$TERM variable.
Peter Keller <address@hidden> wrote:
> Richard Riley <address@hidden> wrote:
>> Peter Keller <address@hidden> 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
>
>
>
>
>
>