Files
Netcatty/docs/research/autocomplete-descriptions-batch-3.md
T
rnarany 51d9f715da feat(autocomplete): localize common commands and polish terminal hints (#4172)
* feat(autocomplete): add zh-CN descriptions for zip, unzip, make, nano

Cover 32 missing Fig descriptions, generate zh-TW, add batch coverage tests, and record source and semantic checks.

* fix(autocomplete): correct zip, unzip, and make semantics

Limit zip -9 to the compression level, warn that unzip -0 is a suspect upstream option, and describe make -N as the Apple/NeXT compatibility extension.

* fix(autocomplete): simplify unzip -0 warning and correct NeXT note

Keep the -O gbk version caveat in the research record and describe Next/NeXT as a capitalization difference.

* feat(autocomplete): complete remaining common command descriptions

Add 177 zh-CN descriptions for python, python3, node, vim, sort, awk, and sed; generate zh-TW, cover the batch with real Fig specs, and record one deferred shared node key.

* fix(autocomplete): correct sed n and sort parallel semantics

Add the automatic-print condition to sed n, remove the universal CPU default from sort --parallel, and remove duplicated adopted-entry sections from the source record.

* fix: repair macOS terminal setup and align autocomplete details

- Read OSC 7 setup payloads through base64 stdin so BSD/macOS works
- Keep the FIDO askpass socket path within the Unix sun_path limit
- Align autocomplete descriptions in a shared fixed column
- Fix an invalid optional-parameter declaration and lint warnings
- Harden macOS-sensitive OSC 7, SFTP, temp-dir and privacy tests

* feat(autocomplete): add zh-CN descriptions for file and text utilities

Cover ln, stat, wc, cut, uniq, tee and xargs with 70 localized
descriptions. Add coverage and localization tests, preload the new common
specs, and record the upstream wc/xargs wording corrections.

* fix(autocomplete): keep popup scrollbars draggable

Panel mousedown handlers no longer preventDefault across the whole box, so the right-side detail scrollbar and the suggestion list scrollbar can be dragged while padding clicks still preserve terminal focus.

* fix(autocomplete): keep detail panel open while selecting text

Delay row hover clearing so the pointer can move into the right-side detail panel, and allow native text selection there without stealing terminal focus on ordinary padding clicks.
2026-11-07 20:00:43 +08:00

4.6 KiB

Autocomplete description overlay: file/text utilities batch

This batch continues the offline Fig description overlay after the python/node/vim/sort/awk/sed batch. The Fig specs keep their English names, arguments, and structure; only suggestion descriptions are localized for zh-CN and generated into zh-TW.

Scope: ln, stat, wc, cut, uniq, tee, and xargs. The batch adopts 70 previously untranslated English keys.

Sources

Source Version / location Used for
@withfig/autocomplete 2.692.3, npm gitHead aef52acff84c45edde61ae610cc2c964802b9a38; src/{ln,stat,wc,cut,uniq,tee,xargs}.ts and compiled build/*.js English keys, option names, and arguments
GNU Coreutils 9.12, wc, cut, uniq, tee, xargs invocations Shared GNU option semantics
BSD/macOS manuals local macOS 26.7 man ln, stat, wc, cut, uniq, tee, xargs BSD-specific behavior exposed by the Fig specs
jaywcjlove/linux-command repository HEAD 8041aeda04762e136078decb2de201ec4348527c (2026-10-31) Simplified-Chinese terminology where available

Checked on 2026-11-07. Every adopted English key occurs only in one of these seven specs in the bundled Fig package; no other command shares these keys.

Coverage

Command Adopted Notes
ln 8 hard/symbolic link flags
stat 12 BSD/macOS stat output formats
wc 6 byte/line/character/word counts
cut 11 byte/column/field selection
uniq 10 repeated/unique line filtering
tee 4 append and signal handling
xargs 19 replacement, batching, and parallel execution

Total adopted: 70 unique English keys.

The seven commands are also added to COMMON_FIG_SPECS so their specs are preloaded with the other common commands instead of waiting for an on-demand load.

Semantic notes

  • wc: the upstream description says “World, line, character, and byte count”. This is an upstream typo for “Word”; the zh-CN text translates the intended word-count meaning and does not repeat the typo.
  • xargs: the upstream -x description says “Terminal if the arguments will not fit in the maximum line length”. This is an upstream typo for “Terminate”; the zh-CN text says the command terminates instead.
  • cut: the upstream -d argument description uses “deliminator”. The zh-CN text uses the standard term 字段分隔符 and keeps delim as a literal placeholder from the option description.
  • stat: the Fig spec follows the BSD/macOS stat output formats (-F, -l, -r, -s, -t), not GNU stat. The translations keep those BSD meanings rather than substituting GNU --format wording.
  • uniq: -c/--count, -d/--repeated, and -D/--all-repeated are separate suggestions in the Fig spec; both the short and long spellings keep the same localized explanation.

Adopted entries

Command English zh-CN
ln Create (default hard) symbolic links to files 为文件创建符号链接(默认为硬链接)
ln -s Create a symbolic link 创建符号链接
stat Display file status 显示文件状态
stat -f Display information using the specified format; similar to printf(3) formats in that they start with %, are then followed by a sequence of formatting characters, and end in a character that selects the field of the struct stat which is to be formatted 按指定格式显示信息;类似 printf(3):以 % 开头,后接格式化字符,并以选择 struct stat 待格式化字段的字符结尾
wc World, line, character, and byte count 统计单词数、行数、字符数和字节数
cut Cut out selected portions of each line of a file 从文件的每一行中截取选定部分
cut -d Use delim as the field delimiter character instead of the tab character 使用 delim 作为字段分隔符,而不是制表符
uniq -c Prefix lines by the number of occurrences 在每行前加上出现次数
tee -a Append the output to the files rather than overwriting them 将输出追加到文件而不是覆盖
xargs -0 Use NUL (0x00) as a separator, instead of whitespace 使用 NUL(0x00)而非空白作为分隔符
xargs -x Terminal if the arguments will not fit in the maximum line length 若参数超出最大行长度则终止

zh-TW is generated from these values with node scripts/generate-autocomplete-descriptions-zh-TW.mjs (OpenCC s2twp), not edited by hand. Spot checks include 檔案, 預設, 欄位, 訊號, and 引數.