Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zkbd on OS X



Phil Pennock wrote:
On 2012-01-02 at 16:57 -0200, Daniel Serodio (lists) wrote:
Since 4.3.5 or so[1], zkbd uses ${DISPLAY:-$VENDOR-$OSTYPE} instead of

Has anyone had this problem before? Am I doing something wrong?

You're not doing anything wrong; it was an Xorg/XFree86 assumption about
the value of $DISPLAY, ":0", ":0.0", "hostname:0" or the like.
("hostname:displaynumber.screennumber").  I think that this might be an
X11 requirement ...

On MacOS, it's a Unix-domain socket, used by launchd to dynamically
start up the X11 server when a client opens the socket, and hand off to
the running server.  From an X point of view, this should still have
been exposed as ":0" and the local transport could have been chosen
behind the scenes to be via a Unix-domain socket which triggers the
launchd behaviour.  Alas, Mac's are gratuitously different here.

How about:
----------------------------8<  cut here>8------------------------------
if [[ -z "$DISPLAY" || $DISPLAY == */* ]]; then
   termID="$VENDOR-$OSTYPE"
else
   termID="$DISPLAY"
fi
----------------------------8<  cut here>8------------------------------
Works fine for me, but this fix has to me made not only where zkbd moves the temporary file but also when sourceing it in ~/.zshrc

The corresponding lines in .zshrc look somewhat like a kludge.

I was wondering the same thing as Mikael: why does zsh use $DISPLAY in the first place? IMHO, it doesn't make sense to have different keymapping in :1 then in :0, and having to setup the keyboard when $DISPLAY changes.

Regards,
Daniel Serodio


Messages sorted by: Reverse Date, Date, Thread, Author