Skip to content

feat(terminalfont): add kmscon font detection#2394

Closed
1hpEcVns wants to merge 19 commits into
fastfetch-cli:masterfrom
1hpEcVns:feat/kmscon-terminalfont
Closed

feat(terminalfont): add kmscon font detection#2394
1hpEcVns wants to merge 19 commits into
fastfetch-cli:masterfrom
1hpEcVns:feat/kmscon-terminalfont

Conversation

@1hpEcVns

Copy link
Copy Markdown

Summary

Adds kmscon (kernel mode setting framebuffer console) support to the TerminalFont module.

Problem

fastfetch -s TerminalFont --show-errors returned Unknown terminal: kmscon because kmscon was not in the list of ~30 known terminals.

Solution

Read kmscon's config file to extract font-name and font-size:

  1. Parse /proc/<pid>/cmdline to find the --configdir argument
  2. Read <configdir>/kmscon.conf (falls back to /etc/kmscon/kmscon.conf)
  3. Extract font-name= and font-size= key-value pairs

Before

Terminal Font: Unknown terminal: kmscon

After

Terminal Font: Maple Mono NF CN (16px)

Closes #2393

@codacy-production

codacy-production Bot commented Jun 10, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 6 critical

Alerts:
⚠ 6 issues (≤ 0 issues of at least minor severity)

Results:
6 new issues

Category Results
Security 6 critical

View in Codacy

🟢 Metrics 41 complexity · 0 duplication

Metric Results
Complexity 41
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@CarterLi

Copy link
Copy Markdown
Member

Please target dev branch.

@1hpEcVns

Copy link
Copy Markdown
Author

已在 dev 分支上。已修复 Codacy 报告的 8 个安全漏洞:将 strlen/ffStrEquals 替换为 memmem/memchr(NUL 分隔数据安全遍历),configdir 从裸指针改为复制到独立 strbuf,并限制只接受绝对路径。此改动由 AI 辅助生成。

Read kmscon's config file (found via --configdir in /proc/<pid>/cmdline,
falling back to /etc/kmscon/kmscon.conf) to extract font-name and font-size.

Fixes #2393
@1hpEcVns 1hpEcVns force-pushed the feat/kmscon-terminalfont branch from 6a69cbd to defc118 Compare June 10, 2026 17:32
@CarterLi CarterLi closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants