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

feat: ansi for pipe rows #2192

Open
saeedark wants to merge 4 commits from saeedark/foot:row2richpr into master
pull from: saeedark/foot:row2richpr
merge into: dnkl:master
dnkl:master
dnkl:osc-5522
dnkl:sixel-heap-buffer-overflow
dnkl:releases/1.27
dnkl:releases/1.26
dnkl:releases/1.25
dnkl:releases/1.24
dnkl:multi-cursor
dnkl:releases/1.23
dnkl:pixman-16f-2
dnkl:releases/1.22
dnkl:releases/1.21
dnkl:releases/1.20
dnkl:releases/1.19
dnkl:releases/1.18
dnkl:releases/1.17
dnkl:releases/1.16
dnkl:releases/1.15
dnkl:releases/1.14
dnkl:releases/1.13
dnkl:releases/1.12
dnkl:releases/1.11
dnkl:releases/1.10
dnkl:releases/1.9
dnkl:releases/1.8
dnkl:releases/1.7
dnkl:releases/1.6
dnkl:releases/1.5
dnkl:releases/1.4
dnkl:releases/1.3
dnkl:releases/1.2
dnkl:releases/1.1
dnkl:releases/1.0
First-time contributor
Copy link

Hi,
Thank you for developing foot.

This PR adds ANSI as an option for pipe and copy selection.
Personally, I don't think that "copying" should have ANSI stuff but it had been discussed and since the code changes where rather small I add it.

The real use case is to pipe the view/command_output into a pager and still have access to styles and more importantly hyperlinks. (as an example ov supports some and also has keybinding to disable them.)

I don't excel in coding, so it's frightening and needs refactoring.

also these should be added to config fiel
ansi-pipe=true
toggle-ansi-selection=key+bindings

Thanks

Hi, Thank you for developing foot. This PR adds ANSI as an option for pipe and copy selection. Personally, I don't think that "copying" should have ANSI stuff but it had been [discussed](https://codeberg.org/dnkl/foot/issues/2004) and since the code changes where rather small I add it. The real use case is to pipe the view/command_output into a pager and still have access to styles and more importantly hyperlinks. (as an example [ov](http://github.com/noborus/ov) supports some and also has keybinding to disable them.) I don't excel in coding, so it's frightening and needs refactoring. also these should be added to config fiel `ansi-pipe=true` `toggle-ansi-selection=key+bindings` Thanks
saeedark changed title from (削除) WIP: feat: ansi for pipe rows (削除ここまで) to feat: ansi for pipe rows 2025年10月10日 11:45:06 +02:00
Owner
Copy link

Thank you for this PR!

This is not something I'm willing to merge at the time being, given that a) it's quite big and b) there hasn't really been that much interest in the feature.

That said, I don't think it's necessary to close the PR. Let's keep it around. If there's more interest in the future, we can re-consider merging it.

Thank you for this PR! This is not something I'm willing to merge at the time being, given that a) it's quite big and b) there hasn't really been that much interest in the feature. That said, I don't think it's necessary to close the PR. Let's keep it around. If there's more interest in the future, we can re-consider merging it.
saeedark force-pushed row2richpr from 6a6c3454cc
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
builds.sr.ht/freebsd-x64 Job completed
ci/woodpecker/pull_request_metadata/woodpecker Pipeline is pending approval
to 02245ea733
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
builds.sr.ht/freebsd-x64 Job completed
2025年10月11日 13:17:20 +02:00
Compare
saeedark force-pushed row2richpr from 02245ea733
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
builds.sr.ht/freebsd-x64 Job completed
to ce63279994
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
builds.sr.ht/freebsd-x64 Job completed
2025年10月28日 22:35:43 +01:00
Compare
chore: return instead of goto
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
builds.sr.ht/freebsd-x64 Job completed
49c54a2931
Author
First-time contributor
Copy link

Just for the record. Using delta and piping it to a pager results in truncated highlight.
Though, not ideal, it is expected behaviour. Because we are, in the end, recreating the text and its corresponding ansi attributes, some choices should be made. (regarding linebreaks and empty spaces.)

Just for the record. Using [delta](http://dandavison.github.io/delta/) and piping it to a pager results in truncated highlight. Though, not ideal, it is expected behaviour. Because we are, in the end, recreating the text and its corresponding ansi attributes, some choices should be made. (regarding linebreaks and empty spaces.)
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
builds.sr.ht/freebsd-x64 Job completed
This pull request has changes conflicting with the target branch.
  • config.c
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u row2richpr:saeedark-row2richpr
git switch saeedark-row2richpr

Merge

Merge the changes and update on Forgejo.
git switch master
git merge --no-ff saeedark-row2richpr
git switch saeedark-row2richpr
git rebase master
git switch master
git merge --ff-only saeedark-row2richpr
git switch saeedark-row2richpr
git rebase master
git switch master
git merge --no-ff saeedark-row2richpr
git switch master
git merge --squash saeedark-row2richpr
git switch master
git merge --ff-only saeedark-row2richpr
git switch master
git merge saeedark-row2richpr
git push origin master
Sign in to join this conversation.
No reviewers
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!2192
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "saeedark/foot:row2richpr"

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?