Skip to content

Instantly share code, notes, and snippets.

@Hamayama
Last active January 22, 2021 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hamayama/16268a9d607eaebcc56df907eac97cd2 to your computer and use it in GitHub Desktop.
Save Hamayama/16268a9d607eaebcc56df907eac97cd2 to your computer and use it in GitHub Desktop.
Lem エディタの ConEmu 上での実行方法

Lem エディタの ConEmu 上での実行方法

  • Windows 環境において、Lem エディタを ConEmu 上で実行する方法をまとめたものです。

  • mintty + winpty 上では 16 色 しか表示できませんでした (winpty の制約による) が、
    ConEmu 上では 256 色 で表示することができます。
    (参考URL: rprichard/winpty#108
    https://conemu.github.io/en/Xterm256Colors.html )

    <<現状、Windows 10 では、256 色表示が正常にできません(色付けの範囲がずれます)>>

事前準備

  • 事前に、Lem エディタ および ConEmu が、適切にインストールされている必要があります。

  • Lem エディタの Windows 上でのインストール手順については、以下のページを参照ください。
    https://gist.github.com/Hamayama/deba598ab70f5d5d6952b51f82793473
    (現状、MSYS2/MinGW-w64 の開発環境が必要です)
    (Windows 10 では、PDCurses の改造版 (PDCurses-win10-jp) のインストールが必要です)

  • ConEmu については、ホームページ ( https://conemu.github.io/ ) から、
    Preview 版 もしくは Alpha 版 をダウンロードしてインストールしてください。

設定

  1. ConEmu の設定は、Settings メニューにより、以下のようにします。
    (バージョン 191012 で確認)

    Settings - General
      Choose color scheme - <Default Windows scheme>
        (Lem の設定との不一致を避けるため)
    Settings - General
      Inject ConEmuHk.dll into all processes started in ConEmu tabs - ON
        (この設定をしないと、ANSI escape sequence を処理できない)
    Settings - General - Fonts
      Main console font - Consolas
      Compress long strings to fit space - OFF
      Alternative font  - Consolas
        (font は、表示が乱れない等幅フォントであればよい
         (「Consolas」「MS ゴシック」「Lucida Console」等))
    Settings - Features - Colors
      TrueMod (24bit color) support - ON
        (ここを OFF にすると 16 色になる)
    

    (Windows 10 では、現状、256 色表示に不具合がある (色付けの範囲がずれる) ため、
    TrueMod (24bit color) support を OFF にしてください)

  2. pdcurses.dll に PATH が通っている必要があります。
    (例えば、MSYS2 の c:/msys64/mingw64/bin フォルダにある pdcurses.dll を、
    Roswell のフォルダにコピーする等)

実行

  • ConEmu を起動して、以下のように実行します。
    (Windows 8.1 では、chcp 65001 を実行しないと、日本語の表示が乱れるので注意)

    chcp 65001
    ros -Q -s lem-pdcurses -L sbcl-bin -- %USERPROFILE%\.roswell\bin\lem-ncurses
    
  • または、lem.bat を以下の内容で作成して、Roswell のフォルダ等に入れておけば、lem のみで起動できます。

    chcp 65001
    ros -Q -s lem-pdcurses -L sbcl-bin -- %USERPROFILE%\.roswell\bin\lem-ncurses %*
    
  • もしくは、lem_conemu.bat を、以下の内容で作成して実行すると、
    ConEmu の画面を新しく表示して Lem を起動できます。

    cd %USERPROFILE%
    start ConEmu64.exe -run chcp 65001 ^& ros -Q -s lem-pdcurses -L sbcl-bin -- %USERPROFILE%\.roswell\bin\lem-ncurses %*
    

制限事項等

  1. キー入力で、C-v がペーストになってしまうので、スクロールするには、
    PageDown (機種によっては Fn + Down) を使う必要がある。
    → Settings - Keys & Macro の Hotkeys の設定で、キー割り当てを変更できるもよう
    ( https://laboradian.com/cmder-conemu-my-settings/ )

  2. ○ × 等の文字を表示すると、画面の縦分割の表示位置がずれる。
    → 修正方法については、以下のページを参照
    https://gist.github.com/Hamayama/12d5e637fc684e1d7e58e96aad5d0728
    (現状、Windows 10 では、あまり改善できていません)

その他 情報等

(2020-4-6)(2020-5-10)(2020-10-12)(2020-11-3)(2020-11-19)
(2020-11-23)(2021-1-22)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment