Skip to content

fix: use printf for portable ANSI box rendering#1

Open
rjbudzynski wants to merge 1 commit into
JeromeTDev:masterfrom
rjbudzynski:fix/box-rendering
Open

fix: use printf for portable ANSI box rendering#1
rjbudzynski wants to merge 1 commit into
JeromeTDev:masterfrom
rjbudzynski:fix/box-rendering

Conversation

@rjbudzynski
Copy link
Copy Markdown

Problem

The draw_box function uses echo -e with \e escape sequences, which are not interpreted on macOS/BSD and in some terminals like Ghostty. The ANSI color codes render as literal text instead of coloring the box.

Fix

  • Replace echo -e with printf using \033 octal escape sequences — portable across all POSIX platforms
  • Add leading/trailing space padding to the box message for better readability

- Replace echo -e with printf for cross-platform compatibility (macOS/BSD)
- Add padding inside box for better visual appearance
- Use \033 octal escape instead of \e which isn't portable

Fixes box rendering in terminals like Ghostty where \e is not interpreted.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
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.

1 participant