Logs page renders blank when LANG is a CJK locale on Flatpak (monospace resolves to proportional Noto Sans CJK)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust, typescript
調査の方向性
packages/ui/src/composables/terminal.tsから始めます。issueによると、ここでターミナルはフォントファミリーを汎用のmonospaceに設定しています。Logsページでxterm.jsをどのように設定しているか、また近くのテストでターミナルのレンダリングをカバーしているかを確認します。FlatpakでCJKのLANGを指定して再現し、en_US.UTF-8と比較します。CJKロケールでログと空の状態の両方がレンダリングされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Please confirm the following
- I checked the existing issues for duplicate problems
- I have tried resolving the issue using the support portal
- I have ensured my Modrinth App installation is up to date
What version of the Modrinth App are you using?
0.22.0 (Flathub, com.modrinth.ModrinthApp, runtime org.gnome.Platform/x86_64/49)
What operating systems are you seeing the problem on?
Linux — Fedora 44, KDE Plasma (Wayland), system locale zh_CN.UTF-8
Describe the bug
When the system/process locale is Chinese (LANG=zh_CN.UTF-8), the instance Logs page renders an entirely blank terminal, even though the logs are read successfully.
The page chrome (search box, level filters, log-source dropdown) works, and the dropdown correctly lists latest.log, crash reports, and rotated .log.gz files. Selecting any of them still leaves the terminal blank. The empty-state message/frog does not appear either, which suggests the xterm.js terminal never renders any text.
Launching the same Flatpak with LANG=en_US.UTF-8 makes the Logs page work normally, so the data/back-end side is fine — this is a rendering issue.
The same instance shows:
LANG=zh_CN.UTF-8: an empty white terminal area
LANG=en_US.UTF-8: empty-state bubble and log contents render normally
Steps to reproduce
- Use a system with
LANG=zh_CN.UTF-8(or any CJK locale), and install Modrinth App from Flathub. - Open an instance that has logs (or launch the instance once so logs exist).
- Go to the instance Logs tab.
- Observe that the terminal area is completely blank, including no empty-state text.
Optional control:
flatpak run --env=LANG=en_US.UTF-8 com.modrinth.ModrinthApp
→ the Logs page renders correctly.
Expected behavior
The Logs page should display the live log / selected log file regardless of the system locale.
Additional context / root cause analysis
Inside the Flatpak sandbox, fontconfig resolves the generic monospace family differently depending on locale:
$ flatpak run --command=sh com.modrinth.ModrinthApp -c \
'LANG=en_US.UTF-8 fc-match monospace; LANG=zh_CN.UTF-8 fc-match monospace'
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
NotoSansCJK-VF.ttc: "Noto Sans CJK SC" "Regular"
Noto Sans CJK SC is a proportional CJK font, not a monospace font. The console component hard-codes the generic family:
// packages/ui/src/composables/terminal.ts (v0.22.0)
fontFamily: 'monospace',
xterm.js requires a monospace font for its character-width measurement. When the generic monospace alias resolves to a proportional (and variable) CJK font, the terminal produces no visible output at all — not even the empty-state bubble.
Note that the actual monospace CJK font is present in the sandbox (fc-list shows Noto Sans Mono CJK SC); fontconfig just prefers the proportional Noto Sans CJK SC under zh_CN.
Workaround (app-local, does not affect other apps):
Create ~/.var/app/com.modrinth.ModrinthApp/config/fontconfig/fonts.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family"><string>monospace</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans Mono</string>
</edit>
</match>
</fontconfig>
After this, LANG=zh_CN.UTF-8 fc-match monospace inside the sandbox returns DejaVu Sans Mono and the Logs page renders again (CJK characters fall back to Noto CJK automatically).
Suggested fix: don't rely on the bare generic monospace alias for the terminal. Use an explicit monospace stack, e.g.
fontFamily: "'DejaVu Sans Mono', 'Noto Sans Mono', 'Noto Sans Mono CJK SC', 'Liberation Mono', monospace",
and/or ship a known monospace font with the app. It may also be worth checking whether xterm.js needs a guard against a resolved proportional font.
- 主要言語
- Rust
- スター
- 2.5k
- フォーク
- 663
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 122
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modrinth/code のほかの issue
-
app
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
website
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modrinth/code#8256 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modrinth/code#8253 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Translation errorオープンwebsite
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
Button reorder request再び着手できるかも @Ceebug が 17 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
modrinth/code#8136 · コメント 10 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Eyevinn/open-live-ingest#36 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug bug jury peripheral:i2s
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
esp-rs/esp-hal#6828 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
ライブラリを追加オープンpriority middle
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
KATO-Hiro/AtCoderClans#13015 ·
メンテナーはふだん 1 日以内に返信
-
needs-review
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
UCS-Care-Group/mailcraft#1429 ·
メンテナーはふだん 1 日以内に返信