xmodmap, readline, and ye olde meta key
xmodmap, readline, and ye olde meta key
- Subject: xmodmap, readline, and ye olde meta key
- From: "James K. Lowden" <email@hidden>
- Date: Fri, 31 Dec 2010 00:33:30 -0500
Greetings,
I got a brand new MacBook Pro running 10.6.5 for Christmas. I'm having a
little trouble understanding how X and xterms are initialized, and what I
can and can't expect to work. My search of this list's archives finds
many references to readline, but most of them seem to have to do with
emacs or some Java thing.
My issue is with bash. Specifically, I'd like:
1. move-by-word to work by pressing alt-f and alt-b
2. bash to run ${HOME}/.profile when I press cmd-n to open a new xterm
3. to invoke xmodmap when X initializes
(Regarding #2, I think I want "xterm -ls".)
If this is documented in the man pages, I'd appreciate a pointer. (The
docs could use a little TLC. X(1) refers to XDarwin, which has no man
page, in SEE ALSO. xinit(1) mentions Xquartz without aaying anything
about how Xquartz supersedes some of what xinit claims to do. I find no
reliable information on whether or no ${HOME}/.xinitrc is supposed to
work. When I tried, it prevented X from starting.)
Back in the XFree86 days on my G4, alt-f and alt-b moved forward and back
by word on the command line, much as they do on my PC keyboard running
NetBSD. I would like that to work on my new machine, too.
I think I could do this with xmodmap(1) or ~/.inputrc (for readline(3)) or
with defaults(1). Having tried and failed with xmodmap, I'm guessing I
should use defaults, but I'd like to understand why.
With the following, bash lets me move back and forth by word using
cmd-alt-b and cmd-alt-f (!) Which knob do I turn to relieve me of using
the cmd key?
$ xmodmap -p
xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44)
lock Caps_Lock (0x41)
control Control_L (0x43), Control_R (0x46)
mod1 Meta_L (0x42), Mode_switch (0x45)
mod2 Meta_L (0x3f), Meta_R (0x47)
mod3
mod4
mod5
$ cat ~/.xmodmaprc
keycode 84 = Multi_key
keycode 66 = Meta_L
(keycode 84 was the "Enter" (not return) on my old Powerbook. I see that
key's gone now. What's your favorite Compose key?)
$ defaults read org.x.X11
{
"NSWindow Frame x11_prefs" = "266 365 484 330 0 0 1920 1178 ";
"app_to_run" = "/usr/X11/bin/xterm";
"cache_fonts" = 1;
"done_xinit_check" = 1;
"enable_fake_buttons" = 1;
"enable_key_equivalents" = 1;
"login_shell" = "/bin/sh";
"no_auth" = 0;
"nolisten_tcp" = 1;
"sync_keymap" = 0;
}
Below are messages from the console, in case that helps. It seems to show
X11.app invoking xterm without options via /bin/sh. Not sure how to get
it to pass "-ls".
Many thanks for any guidance.
--jkl
12/30/10 12:21:57 AM [0x0-0x38038].org.x.X11[5417] Quitting Xquartz...
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: main():
argc=2
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[0] =
/Applications/Utilities/X11.app/Contents/MacOS/X11.bin
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[1] =
-psn_0_245820
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] Waiting for startup
parameters via Mach IPC.
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Listening
on socket for fd handoff: (4) /var/tmp/tmp.0.mV2bJ4
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Thread
created for handoff. Returning success to tell caller to connect and push
the fd.
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Received
new $DISPLAY fd: 6 ... sleeping to allow xinitrc to catchup.
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X11.app:
do_start_x11_server(): argc=6
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[0] =
/usr/X11/bin/X
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[1] = :0
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[2] =
-nolisten
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[3] = tcp
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[4] = -auth
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] argv[5] =
/Users/jklowden/.serverauth.5644
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] Xquartz starting:
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] X.Org X Server
1.4.2-apple56
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] Build Date: 20100624
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] (EE) XKB: Couldn't
open rules file /usr/X11/share/X11/xkb/rules/base
12/30/10 12:22:04 AM [0x0-0x3c03c].org.x.X11[5634] (EE) XKB: Couldn't
open rules file /usr/X11/share/X11/xkb/rules/base
12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] X11.app Handing off
fd to server thread via DarwinListenOnOpenFD(6)
12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634]
DarwinListenOnOpenFD: 6
12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] Calling
ListenOnOpenFD() for new fd: 6
12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] X11.app: Launching
/usr/X11/bin/xterm:
12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] argv[0] = /bin/sh
12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] argv[1] = -c
12/30/10 12:22:07 AM [0x0-0x3c03c].org.x.X11[5634] argv[2] =
/usr/X11/bin/xterm
12/30/10 10:15:15 PM [0x0-0x3c03c].org.x.X11[5634] mieqEnequeue:
out-of-order valuator event; dropping.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden