zsh-users
 help / color / mirror / code / Atom feed
* The opposite of bindkey -m
@ 2006-09-02 15:46 Meino Christian Cramer
  2006-09-02 18:21 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Meino Christian Cramer @ 2006-09-02 15:46 UTC (permalink / raw)
  To: zsh-users

Hi,

 in a previous mail I asked, whether it is possible to change zsh to
 understand meta-keys in "binary form" instead of keycombinations with
 <ESC>->key>, cause vim understands only those - "bindkey -m" was the
 solution. 

 Now the midnight commander only partly works, since it insists of
 getting the other kind of meta-keys: <ESC>-key.

 Is there any way to "disable" bindkey -m without restarting zsh ?
 If yes I could create an alias of the form "alias mc='bindkey <something>; mc'
 
 Kind regards,
 mcc 


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

* Re: The opposite of bindkey -m
  2006-09-02 15:46 The opposite of bindkey -m Meino Christian Cramer
@ 2006-09-02 18:21 ` Bart Schaefer
  2006-09-03  1:12   ` Meino Christian Cramer
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2006-09-02 18:21 UTC (permalink / raw)
  To: zsh-users

On Sep 2,  5:46pm, Meino Christian Cramer wrote:
> 
>  Is there any way to "disable" bindkey -m without restarting zsh ?

I think you're confused about something here.

Vim, zsh, and mc are all just programs getting their input from a
terminal or terminal emulator.  The key bindings in zsh do not affect
what is sent by the terminal to any of the other programs; they only
affect how zsh interprets the input that is sent to it.  When zsh runs
an external program like vim or mc, it steps completely aside, so those
programs are getting input directly from the terminal, not "mediated"
through zsh's key bindings.

Thus "bindkey -m" is not what causes the terminal to send what you're
calling "binary" to zsh or to vim, it's only telling zsh what to do
when it receives binary.  Control of what is sent is somewhere else,
probably in a terminfo definition.  In other words, you must have
changed something other than just bindkey, and you may have changed
it somewhere external to zsh (such as in your terminal emulator's
configuration file).

If it's the terminfo, the setting of the TERM variable can change to
an alternate definition, and you might "fix" mc by something like

	alias mc='TERM=vt100 mc'

(choose a more appropriate value for TERM than vt100, that's just an
example).  If instead it's the emulator's configuration, the TERM
setting might also help if you can find one that matches what the
emulator is sending -- but if that doesn't work, you may not be able
to get both vim and mc to receive the input they expect.  Either way
the solution won't have anything to do with zsh key bindings.


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

* Re: The opposite of bindkey -m
  2006-09-02 18:21 ` Bart Schaefer
@ 2006-09-03  1:12   ` Meino Christian Cramer
  2006-09-03  5:24     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Meino Christian Cramer @ 2006-09-03  1:12 UTC (permalink / raw)
  To: schaefer; +Cc: zsh-users

From: Bart Schaefer <schaefer@brasslantern.com>
Subject: Re: The opposite of bindkey -m
Date: Sat, 02 Sep 2006 11:21:43 -0700

> On Sep 2,  5:46pm, Meino Christian Cramer wrote:
> > 
> >  Is there any way to "disable" bindkey -m without restarting zsh ?
> 
> I think you're confused about something here.
> 
> Vim, zsh, and mc are all just programs getting their input from a
> terminal or terminal emulator.  The key bindings in zsh do not affect
> what is sent by the terminal to any of the other programs; they only
> affect how zsh interprets the input that is sent to it.  When zsh runs
> an external program like vim or mc, it steps completely aside, so those
> programs are getting input directly from the terminal, not "mediated"
> through zsh's key bindings.
> 
> Thus "bindkey -m" is not what causes the terminal to send what you're
> calling "binary" to zsh or to vim, it's only telling zsh what to do
> when it receives binary.  Control of what is sent is somewhere else,
> probably in a terminfo definition.  In other words, you must have
> changed something other than just bindkey, and you may have changed
> it somewhere external to zsh (such as in your terminal emulator's
> configuration file).
> 
> If it's the terminfo, the setting of the TERM variable can change to
> an alternate definition, and you might "fix" mc by something like
> 
> 	alias mc='TERM=vt100 mc'
> 
> (choose a more appropriate value for TERM than vt100, that's just an
> example).  If instead it's the emulator's configuration, the TERM
> setting might also help if you can find one that matches what the
> emulator is sending -- but if that doesn't work, you may not be able
> to get both vim and mc to receive the input they expect.  Either way
> the solution won't have anything to do with zsh key bindings.
> 

Hi Bart,

 thanks for the explanations. :) 

 I thought, that the input would be chained:

 (input)->mrxvt->zsh->mc

 because these apps were started in that order.

 Yes, I have changed mrxvt via the option "-m8" to produce Meta-keys
 as "binary" values (sorry, dont know, what the correct terminux
 technicus is here...) instead of key sequences.

 I thnk, I get lost here. 

 The only way seems to be an alias of that form:

 alias='mrxvt -e mc'  #...leaving off the "-m8"

 but this will popup a new window. One reason for choosing mc was,
 that it does not create a new window and runs in the current
 terminal.
 Sigh

 keep hacking!
 mcc


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

* Re: The opposite of bindkey -m
  2006-09-03  1:12   ` Meino Christian Cramer
@ 2006-09-03  5:24     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2006-09-03  5:24 UTC (permalink / raw)
  To: zsh-users

On Sep 3,  3:12am, Meino Christian Cramer wrote:
}
}  I thought, that the input would be chained:
}  (input)->mrxvt->zsh->mc
}  because these apps were started in that order.

It actually happens like this:

 (input)->Xserver->mrxvt-+->zsh
                         |
		         +->mc

That is, if zsh were not wait()ing for mc, it could share the stream
from the terminal ... but each doesn't have its own copy of the stream,
so zsh and mc would be stealing keystrokes from each other, which
obviously you don't want.

}  Yes, I have changed mrxvt via the option "-m8" to produce Meta-keys
}  as "binary" values (sorry, dont know, what the correct terminux
}  technicus is here...) instead of key sequences.
} 
}  I thnk, I get lost here. 

I also misunderstood what you meant.  You mean Meta+x produces either
a single character whose value is 0200+0170, or that it produces the
two characters 033 and 0170.  That's not covered by terminfo, which
only describes things like the arrow keys.

}  The only way seems to be an alias of that form:
} 
}  alias='mrxvt -e mc'  #...leaving off the "-m8"

I installed mrxvt long enough to play with it ... and I can't see any
way to change m8 on the fly.  On the other hand, you can use .vimrc
to map all the Esc-x pairs to their single-byte counterparts, even if
there is no corresponding map file for mc.

-- 


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

end of thread, other threads:[~2006-09-03  5:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-02 15:46 The opposite of bindkey -m Meino Christian Cramer
2006-09-02 18:21 ` Bart Schaefer
2006-09-03  1:12   ` Meino Christian Cramer
2006-09-03  5:24     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).