LoginSignup
4
3

More than 5 years have passed since last update.

Linux上のPharoで日本語を入力する方法

Last updated at Posted at 2019-02-18

zeroconfの場合

./pharo-ui -compositioninput Pharo.image

で起動してください。-compositioninputがミソです。
これはCogVMのオプションなので、Squeakでも同様です。

PharoLauncherの場合

現状のPharo LauncherではVMへのオプションを設定できないので、PharoLauncherに手を入れてみました。VMのキャッシュのスリプトを編集する手もありますが、VMが更新されるたびに編集するのは面倒臭いので、とりあえずPharoLauncherに unix系だったら -compositioninputオプションを付けてPharoを起動するようにしました。

gistにパッチを置きました。

wget https://gist.githubusercontent.com/tomooda/c70abc3efdea398b80137a111e5a919b/raw/64658e381f2ee74008e1abb0b6da8767d115fcf2/PhLImage-launchCommandWithuseSettings.st

をコマンドシェル上で実行して、LinuxをGUIで使っている人は、できたファイルを 既に開いているPharoLauncher 上にドロップしてください。
すると、メニューが出るので、Install into new change setを選んでください。

PharoLauncherウィンドウ上にドロップ

CUIで使っている人は、PharoLauncherで日本語を使えるようにする3つの方法を参考にして、開発者モードにして、上記ファイルをfileinしてください。

そして右下のQuitボタンで、一旦PharoLauncherを終了してください。

スクリーンショット 2019-02-19 7.52.45.png

ウィンドウマネージャの「閉じる」ボタンで終了すると修正が保存されない場合があったり色々面倒なので、必ず Pharo Launcherの右下のQuitボタン を使ってください。

なお、パッチの内容は以下の通りです。決め打ちのハックにすぎないので、そのうち一般化してPharoLauncherにPRします。

launchCommandWith: vmCommand useSettings: usePharoSettings
    | imagePath vmDirectoryPath command basicCommand |
    imagePath := file pathString.
    vmDirectoryPath := vmCommand asFileReference parent fullName.
    command := String
        streamContents: [ :cmd | 
            cmd << 'cd ' << file parent pathString surroundedByDoubleQuotes << ' && '.
            Smalltalk os isUnix
                ifTrue: [ cmd << (self exportLDLibraryPathCommandWith: vmDirectoryPath) << ' && export SQUEAK_PLUGINS="" && ' ].
            cmd << vmCommand surroundedByDoubleQuotes.
            Smalltalk os isUnix ifTrue: [ cmd << ' -compositioninput'].
            cmd << ' ' << imagePath surroundedByDoubleQuotes.
            usePharoSettings ifFalse: [ cmd << ' --no-default-preferences End of statement list encountered ->' ] ].
    basicCommand := self class launchInALoginShell
        ifTrue: [ Smalltalk os isWindows
                ifTrue: [ 'cmd /C ' , command ]
                ifFalse: [ 'bash -l -c ''' , command , '''' ] ]
        ifFalse: [ command ].
    ^ basicCommand utf8Encoded asString
4
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3