| Summary: | less and systemctl are incompatible with each other | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | holger |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | minor | CC: | busybox-cvs, net147 |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
holger
2012-09-19 15:24:05 UTC
(In reply to comment #0) > This is with Busybox 1.20.2. systemctl is using ansi color codes to turn > certain words into red and green and this is printed as: > > systemd-logind.service loaded [[1;31mfailed failed [[0m Login Service > > This appears to be the case because CLEAR_2_EOL is printed on each line. Can you explain what command do you run? "systemctl | less"? Just "systemctl"? This can be reproduced with: systemctl --failed Which outputs: [[1;31m0 loaded units listed.[[0m Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'. The systemctl command invokes less with no arguments (unless you pass --no-pager) and includes ANSI color escape sequences in its output to less. The less command escapes character 27 in the escape sequences as it is non-printable. Similar behavior can be observed with: ls --color / | less (In reply to comment #0) > This is with Busybox 1.20.2. systemctl is using ansi color codes to turn > certain words into red and green and this is printed as: > > systemd-logind.service loaded [[1;31mfailed failed [[0m Login Service This is a bug in systemctl. It has no right to assume pagers understand ANSI escape sequences. I've discovered the same issue with Git v2.3.0: when 'less' in a system is Busybox 'less', `git diff` outputs ANSI colour codes which show up as text. There'll be a way to turn this off in Git, I'm just noting it here as it's a related issue. |