Search code examples
bashshellfish

How to set XMODIFIERS=@im=ibus in Fish shell


How to convert export XMODIFIERS=@im=ibus in Fish shell syntax?

This works fine:

Bash: export GTK_IM_MODULE=ibus

Fish: set -x GTK_IM_MODULE ibus

Following does not work.

But for export XMODIFIERS=@im=ibus , which works in Bash, I am not sure how to match double assignments here in Fish shell.

# Does not work in Fish.
set -x @im ibus
set -x XMODIFIERS @im

Error shown in Fish shell

set: Variable name '@im' is not valid. See `help identifiers`.
~/.config/fish/config.fish (line 31): 
set -x @im ibus
^

Solution

  • You want set -x XMODIFIERS @im=ibus

    In bash export XMODIFIERS=@im=ibus, only the first = sign is interpreted. So this sets an environment variable whose name is XMODIFIERS and whose value is @im=ibus.