dnkl/foot
41
2.0k
Fork
You've already forked foot
243

Tab indentation seems wrong in pipe-view #2194

Closed
opened 2025年10月11日 01:40:19 +02:00 by saeedark · 9 comments

Foot Version

foot version: 1.24.0-13-g371837ef (Oct 11 2025, branch 'masteronn') -pgo +ime -graphemes +assertions

TERM environment variable

foot

Compositor Name and Version

niri

Distribution

ubuntu 24.04

Terminal multiplexer

No response

Shell, TUI, application

fish

Server/standalone mode

  • Standalone
  • Server

Foot config

-

Description of Bug and Steps to Reproduce

Hi.
Thank you for developing foot again.

Piping the term view with tabs in it may not look exactly like the term view! (please see the picture below)

I have no idea how tabs and tab stops work, but the diff attached seems to make output similar to term view. However, I'm not sure changing tabs into spaces is a good idea or not.

picture:
(left side is a pager, right side: foot)
(foot version is different in the picture, but I have reproduced it in mentioned version.)

Relevant logs, stacktraces, etc.

No response

### Foot Version foot version: 1.24.0-13-g371837ef (Oct 11 2025, branch 'masteronn') -pgo +ime -graphemes +assertions ### TERM environment variable foot ### Compositor Name and Version niri ### Distribution ubuntu 24.04 ### Terminal multiplexer _No response_ ### Shell, TUI, application fish ### Server/standalone mode - [ ] Standalone - [ ] Server ### Foot config ```ini - ``` ### Description of Bug and Steps to Reproduce Hi. Thank you for developing foot again. Piping the term view with tabs in it may not look exactly like the term view! (please see the picture below) I have no idea how tabs and tab stops work, but the diff attached seems to make output similar to term view. However, I'm not sure changing tabs into spaces is a good idea or not. picture: (left side is a pager, right side: foot) (foot version is different in the picture, but I have reproduced it in mentioned version.) ### Relevant logs, stacktraces, etc. _No response_
Owner
Copy link

I can't reproduce it here. If you could find a printf "something\t\tsomething else\n" that shows the issue, that would be helpful. I'm not considering any patches until I've understood the problem.

I can't reproduce it here. If you could find a `printf "something\t\tsomething else\n"` that shows the issue, that would be helpful. I'm not considering any patches until I've understood the problem.
Owner
Copy link

This appears to reproduce the issue:

printf "f \tbar\nfo \tbar\nfoo \tbar\nfooo \tbar\nfoooo \tbar\nfooooo \tbar\nfoooooo \tbar\n"

It's most likely an off-by one somewhere.

This appears to reproduce the issue: ```sh printf "f \tbar\nfo \tbar\nfoo \tbar\nfooo \tbar\nfoooo \tbar\nfooooo \tbar\nfoooooo \tbar\n" ``` It's most likely an off-by one somewhere.
Owner
Copy link

Actually no, it only looked like it reproduced because my editor (which I used do display the pipe output) used a different tab length. cat:ing the temporary file in the terminal looks exactly like the original output.

Actually no, it only looked like it reproduced because my editor (which I used do display the pipe output) used a different tab length. `cat`:ing the temporary file in the terminal looks exactly like the original output.

Sorry I'm not an expert in this. Is there a way that I can record my terminal for that example?

Sorry I'm not an expert in this. Is there a way that I can record my terminal for that example?
Owner
Copy link
https://asciinema.org/ might work

nope, asciinema turns everything in spaces.

found one:
printf " f \tbar\tfo \t\t \tbar\n foo \tbar \n fooo \tbar\nfoooo \tbar\n fooooo \tbar\n foooooo \tbar \tfoo \t \t bar \n"

the last column "bar" are not align in terminal, but they are in output

nope, asciinema turns everything in spaces. found one: `printf " f \tbar\tfo \t\t \tbar\n foo \tbar \n fooo \tbar\nfoooo \tbar\n fooooo \tbar\n foooooo \tbar \tfoo \t \t bar \n"` the last column "bar" are not align in terminal, but they are in output
Owner
Copy link

Thanks, that reproduces here as well :)

In fact, this appears to be enough:

$ printf "\t foo\n0123456701234567\n"
Thanks, that reproduces here as well :) In fact, this appears to be enough: ```sh $ printf "\t foo\n0123456701234567\n" ```
Owner
Copy link

Please test #2195

Please test https://codeberg.org/dnkl/foot/pulls/2195

Thank you.

Thank you.
Sign in to join this conversation.
No Branch/Tag specified
master
osc-5522
sixel-heap-buffer-overflow
releases/1.27
releases/1.26
releases/1.25
releases/1.24
multi-cursor
releases/1.23
pixman-16f-2
releases/1.22
releases/1.21
releases/1.20
releases/1.19
releases/1.18
releases/1.17
releases/1.16
releases/1.15
releases/1.14
releases/1.13
releases/1.12
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.27.0
1.26.1
1.26.0
1.25.0
1.24.0
1.23.1
1.23.0
1.22.3
1.22.2
1.22.1
1.22.0
1.21.0
1.20.2
1.20.1
1.20.0
1.19.0
1.18.1
1.18.0
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.3
1.15.2
1.15.1
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.0
1.10.3
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.2
1.7.1
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot#2194
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?