zsh-workers
 help / color / mirror / code / Atom feed
* Z-Shell breaks im-config configuration scripts, making input method malfunction
@ 2014-09-03  6:53 VdragonV字龍
  2014-09-03  7:31 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: VdragonV字龍 @ 2014-09-03  6:53 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 1381 bytes --]

Hi zsh-workers,
I suddenly find out my Chinese input method failed to work properly after I
switched to KDM X display manager(or, the login screen). During debugging I
found that if I sourced the im-config XSession sourced script manually with
Zsh with debugging enabled it will prematurely jump out of
/usr/share/im-config/data/25_hime.rc 's logic, which eventually wrongly set
the environmental variables making the input method malfunctions.

Although it seems to be KDM's bug that uses my default shell(Zsh) to run
the XSession script, it seems abnormal for Zsh to fail at that script also,
thus here's the bug report.

The /usr/share/im-config/data/25_hime.rc script on my system is attached,
and with the execution result of Zsh with debugging enabled.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: zsh 5.0.2-3ubuntu6
ProcVersionSignature: Ubuntu 3.13.0-35.62-lowlatency 3.13.11.6
Uname: Linux 3.13.0-35-lowlatency i686
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.3
Architecture: i386
CurrentDesktop: KDE
Date: Wed Sep 3 14:17:01 2014
InstallationDate: Installed on 2013-03-08 (543 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release i386
(20121017.2)
SourcePackage: zsh
UpgradeStatus: Upgraded to trusty on 2014-04-19 (137 days ago)

Thanks in advance,
V字龍(Vdragon)<Vdragon.Taiwan@gmail.com>

[-- Attachment #1.2: Type: text/html, Size: 2350 bytes --]

[-- Attachment #2: _usr_share_im-config_data_25_hime.rc --]
[-- Type: application/octet-stream, Size: 1271 bytes --]

# start hime
# vim: set sts=4 expandtab:

if [ "$IM_CONFIG_PHASE" = 2 ]; then
# start hime daemon
/usr/bin/hime &
fi

if [ "$IM_CONFIG_PHASE" = 1 ]; then
# set variables for the plain XIM
XMODIFIERS=@im=hime

GTK_IM_MODULE=xim
# use hime immodule only when available for both GTK 2.0 and 3.0

IM_CONFIG_MARKER2=0
for IM_CONFIG_MARKER in /usr/lib/*/gtk-2.0/*/immodules/im-hime.so \
                        /usr/lib/gtk-2.0/*/immodules/im-hime.so ; do
    if [ -e $IM_CONFIG_MARKER ]; then
        IM_CONFIG_MARKER2=1
        break
    fi
done

IM_CONFIG_MARKER3=0
for IM_CONFIG_MARKER in /usr/lib/*/gtk-3.0/*/immodules/im-hime.so \
                        /usr/lib/gtk-3.0/*/immodules/im-hime.so ; do
    if [ -e $IM_CONFIG_MARKER ]; then
        IM_CONFIG_MARKER3=1
        break
    fi
done
if [ $IM_CONFIG_MARKER2 = 1 ] && [ $IM_CONFIG_MARKER3 = 1 ] ; then
    GTK_IM_MODULE=hime
fi

QT4_IM_MODULE=xim
# use immodule when available for Qt4
for IM_CONFIG_MARKER in /usr/lib/*/qt4/plugins/inputmethods/im-hime.so \
                        /usr/lib/qt4/plugins/inputmethods/im-hime.so ; do
    if [ -e $IM_CONFIG_MARKER ]; then
        QT4_IM_MODULE=hime
        break
    fi
done

# hime has no clutter support, and qt3 immodule is not compiled.
CLUTTER_IM_MODULE=xim
fi

[-- Attachment #3: im-config_XSession_script_run_result.output --]
[-- Type: application/octet-stream, Size: 3927 bytes --]

% set -x; source /etc/X11/Xsession.d/70im-config_launch
+/bin/zsh:37> set -x
+/bin/zsh:37> source /etc/X11/Xsession.d/70im-config_launch
+/etc/X11/Xsession.d/70im-config_launch:12> IMLAUNCH=/usr/bin/im-launch 
+/etc/X11/Xsession.d/70im-config_launch:16> [ -z '' ']'
+/etc/X11/Xsession.d/70im-config_launch:17> [ -z '' ']'
+/etc/X11/Xsession.d/70im-config_launch:18> [ -z '' ']'
+/etc/X11/Xsession.d/70im-config_launch:19> [ -z '' ']'
+/etc/X11/Xsession.d/70im-config_launch:20> [ -z '' ']'
+/etc/X11/Xsession.d/70im-config_launch:21> [ -r /usr/share/im-config/xinputrc.common ']'
+/etc/X11/Xsession.d/70im-config_launch:22> IM_CONFIG_PHASE=1 
+/etc/X11/Xsession.d/70im-config_launch:23> export IM_CONFIG_PHASE
+/etc/X11/Xsession.d/70im-config_launch:25> . /usr/share/im-config/xinputrc.common
+/usr/share/im-config/xinputrc.common:9> IM_CONFIG_VERSION=0.24-1ubuntu4.1 
+/usr/share/im-config/xinputrc.common:10> IM_CONFIG_DATA=/usr/share/im-config/data 
+/usr/share/im-config/xinputrc.common:11> IM_CONFIG_XINPUTRC_USR=/home/Vdragon/.xinputrc 
+/usr/share/im-config/xinputrc.common:12> IM_CONFIG_XINPUTRC_SYS=/etc/X11/xinit/xinputrc 
+/usr/share/im-config/xinputrc.common:13> IM_CONFIG_DEFAULT=/etc/default/im-config 
+/usr/share/im-config/xinputrc.common:14> . gettext.sh
+/usr/bin/gettext.sh:20> echo '\t'
+/usr/bin/gettext.sh:20> test 'X        ' '=' 'X\t'
+/usr/bin/gettext.sh:23> printf '%s\n' '\t'
+/usr/bin/gettext.sh:23> test 'X\t' '=' 'X\t'
+/usr/bin/gettext.sh:24> echo='printf %s\n' 
+/usr/bin/gettext.sh:41> test -z set
+/usr/share/im-config/xinputrc.common:15> TEXTDOMAIN=im-config 
+/usr/share/im-config/xinputrc.common:16> export TEXTDOMAIN
+/usr/share/im-config/xinputrc.common:17> TEXTDOMAINDIR=/usr/share/locale/ 
+/usr/share/im-config/xinputrc.common:18> export TEXTDOMAINDIR
+/usr/share/im-config/xinputrc.common:20> [ -r /etc/default/im-config ']'
+/usr/share/im-config/xinputrc.common:21> . /etc/default/im-config
+/etc/default/im-config:4> IM_CONFIG_DEFAULT_MODE=hime 
+/etc/X11/Xsession.d/70im-config_launch:27> [ -r /home/Vdragon/.xinputrc ']'
+/etc/X11/Xsession.d/70im-config_launch:28> . /home/Vdragon/.xinputrc
+/home/Vdragon/.xinputrc:2> run_im hime
+run_im:1> IM_CONFIG_CODE=run_im 
+run_im:2> [ -r /usr/share/im-config/data/25_hime.rc ']'
+run_im:3> . /usr/share/im-config/data/25_hime.rc
+/usr/share/im-config/data/25_hime.rc:4> [ 1 '=' 2 ']'
+/usr/share/im-config/data/25_hime.rc:9> [ 1 '=' 1 ']'
+/usr/share/im-config/data/25_hime.rc:11> XMODIFIERS='@im=hime' 
+/usr/share/im-config/data/25_hime.rc:13> GTK_IM_MODULE=xim 
+/usr/share/im-config/data/25_hime.rc:16> IM_CONFIG_MARKER2=0 
/usr/share/im-config/data/25_hime.rc:17: no matches found: /usr/lib/gtk-2.0/*/immodules/im-hime.so
+/usr/share/im-config/data/25_hime.rc:17> IM_CONFIG_MARKER=/usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/immodules/im-hime.so
+run_im:4> IM_CONFIG_NAME=hime 
+run_im:5> eval_gettext 'Script for $IM_CONFIG_NAME started at $IM_CONFIG_CODE.'
+eval_gettext:1> gettext 'Script for $IM_CONFIG_NAME started at $IM_CONFIG_CODE.'
+eval_gettext:1> envsubst --variables 'Script for $IM_CONFIG_NAME started at $IM_CONFIG_CODE.'
+eval_gettext:1> export PATH IM_CONFIG_NAME IM_CONFIG_CODE
+eval_gettext:1> envsubst 'Script for $IM_CONFIG_NAME started at $IM_CONFIG_CODE.'
hime 使用的 script 從 run_im 啟動。+run_im:6> echo

+/etc/X11/Xsession.d/70im-config_launch:36> export XMODIFIERS
+/etc/X11/Xsession.d/70im-config_launch:37> export GTK_IM_MODULE
+/etc/X11/Xsession.d/70im-config_launch:38> export QT_IM_MODULE
+/etc/X11/Xsession.d/70im-config_launch:39> export QT4_IM_MODULE
+/etc/X11/Xsession.d/70im-config_launch:40> export CLUTTER_IM_MODULE
+/etc/X11/Xsession.d/70im-config_launch:45> [ -x /usr/bin/im-launch ']'
+/etc/X11/Xsession.d/70im-config_launch:46> STARTUP='/usr/bin/im-launch /usr/bin/im-launch /usr/bin/im-launch /usr/bin/im-launch /usr/bin/im-launch ' 
+prompt_adam1_precmd:1> setopt noxtrace localoptions

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

* Re: Z-Shell breaks im-config configuration scripts, making input method malfunction
  2014-09-03  6:53 Z-Shell breaks im-config configuration scripts, making input method malfunction VdragonV字龍
@ 2014-09-03  7:31 ` Bart Schaefer
  2014-09-03  8:00   ` VdragonV字龍
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2014-09-03  7:31 UTC (permalink / raw)
  To: zsh-workers

On Sep 3,  2:53pm, Vdragon0xFF360x5B570x9F8D wrote:
}
} Although it seems to be KDM's bug that uses my default shell(Zsh) to run
} the XSession script, it seems abnormal for Zsh to fail at that script also,
} thus here's the bug report.

Unfortunately, the script breaks for an entirely normal reason as far
as zsh is concerned:  It uses a glob pattern that doesn't match any
files.  The script needs "setopt no_nomatch" to run correctly in zsh
(among possibly other problems, but that's the one that shows up in
your trace output).

As a workaround, you could add "setopt no_nomatch" to your ~/.zshenv
file, and then "setopt nomatch" again in ~/.zshrc or ~/.zlogin.


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

* Re: Z-Shell breaks im-config configuration scripts, making input method malfunction
  2014-09-03  7:31 ` Bart Schaefer
@ 2014-09-03  8:00   ` VdragonV字龍
  0 siblings, 0 replies; 3+ messages in thread
From: VdragonV字龍 @ 2014-09-03  8:00 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Thanks for pointing out, I expected Zsh behaves different than Bash
but wasn't knowledgeable enough to find the issue.  I've patched KDM's
script to avoid this issue already but I'll try your workaround just
for double check, thanks!

V字龍(Vdragon)<Vdragon.Taiwan@gmail.com>

2014-09-03 15:31 GMT+08:00 Bart Schaefer <schaefer@brasslantern.com>:
> On Sep 3,  2:53pm, Vdragon0xFF360x5B570x9F8D wrote:
> }
> } Although it seems to be KDM's bug that uses my default shell(Zsh) to run
> } the XSession script, it seems abnormal for Zsh to fail at that script also,
> } thus here's the bug report.
>
> Unfortunately, the script breaks for an entirely normal reason as far
> as zsh is concerned:  It uses a glob pattern that doesn't match any
> files.  The script needs "setopt no_nomatch" to run correctly in zsh
> (among possibly other problems, but that's the one that shows up in
> your trace output).
>
> As a workaround, you could add "setopt no_nomatch" to your ~/.zshenv
> file, and then "setopt nomatch" again in ~/.zshrc or ~/.zlogin.


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

end of thread, other threads:[~2014-09-03  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03  6:53 Z-Shell breaks im-config configuration scripts, making input method malfunction VdragonV字龍
2014-09-03  7:31 ` Bart Schaefer
2014-09-03  8:00   ` VdragonV字龍

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).