Feature request: configure tab width in rendered Codex CLI/TUI content

Resolved 💬 1 comment Opened Jul 29, 2026 by cowwoc Closed Jul 29, 2026

Summary

Add a user-configurable tab width for content rendered by the Codex CLI/TUI.

Current behavior

Tabs in rendered code, pasted text, and tool output appear to be displayed with a width of 8 spaces. The terminal tab-stop configuration does not seem to affect this rendering.

For example, in WSL, configuring the terminal with two-column tab stops before launching Codex does not change the apparent rendered tab width.

Requested behavior

Add a config.toml setting to control the display width of tab characters, for example:

[tui]
tab_width = 2

The setting could default to 8 for compatibility, while allowing values such as 2 or 4.

This should affect rendering only. It should not modify the underlying text, convert tabs to spaces, or change files being displayed.

Environment

  • Codex CLI/TUI
  • WSL

View original on GitHub ↗

1 Comment

cowwoc · 29 days ago

Correction to my original reproduction:

I initially concluded that terminal tab-stop settings had no effect, but that conclusion was based on an invalid test. I used tabs -2, which is not valid syntax for configuring two-column tab stops. I also launched Codex from Windows through codex.cmd, which invokes wsl.exe bash codex.sh; that non-interactive shell does not source ~/.bashrc.

Codex outputs literal tab characters (U+0009) in code, diffs, and tool output. The terminal renders those characters using its active tab stops. The working fix was to remove the setup from ~/.bashrc and put it in ~/.shell-env, which the wrapper sources, using:

tabs "$(seq -s, 1 2 239)"

After that change, the terminal displayed Codex output at two-column tab stops. Therefore, my reproduction did not demonstrate a Codex defect. The feature request in the issue description remains a separate request for an explicit Codex-side rendering setting.