Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:sh doesn't render tabs correctly #9189

Open
Kelatte opened this issue Dec 30, 2023 · 2 comments
Open

:sh doesn't render tabs correctly #9189

Kelatte opened this issue Dec 30, 2023 · 2 comments
Labels
A-command Area: Commands A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-medium Call for participation: Experience needed to fix: Medium / intermediate

Comments

@Kelatte
Copy link

Kelatte commented Dec 30, 2023

Summary

I have a txt file o. in Helix, typing :sh cat o doesn't output the whole file.

Similarly, if a program output contains tabs, the same problem happens.

If I delete the tabs in o, everything goes fine.

No error message.

Reproduction Steps

2023-12-30.09-26-21.webm

I tried this:

  1. sh cat o

I expected this to happen:

the full file is printed

Instead, this happened:

several lines in the end are not printed.

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

Linux

Terminal Emulator

gnome-terminal v3.48.1 with GNOME 44

Installation Method

dnf

Helix Version

helix 23.10 (f6021dd)

@Kelatte Kelatte added the C-bug Category: This is a bug label Dec 30, 2023
@pascalkuthe pascalkuthe changed the title output of commands buffer is not complete if have tab :sh doesn't render tabs correctly Jan 8, 2024
@pascalkuthe pascalkuthe added A-helix-term Area: Helix term improvements E-medium Call for participation: Experience needed to fix: Medium / intermediate A-command Area: Commands labels Jan 8, 2024
@pascalkuthe
Copy link
Member

pascalkuthe commented Jan 8, 2024

This is cause by us essentially rendering shell output as a markdown codeblock. I am not sure why but the Tabs throw off the markdown parser.

I think it was never a good idea to implement it this way since command output is not necessarily valid shell (and even less likely valid inside markdown).

IMO we should just render this as plaintext or use TS directly in a custom component.

It seems the current rendering code rendering Tabs woth a width of 0. In general I don't trust that text rendering code too much and want to replace it with our existing textrenderong infrastructure anyway.

@mo8it
Copy link
Contributor

mo8it commented Feb 27, 2024

What about opening the output (if it exists) in a new, temporary buffer? That would enable all editor capabilities like navigation, copying etc.
Adding support for ANSI highlighting to that buffer would be awesome! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-medium Call for participation: Experience needed to fix: Medium / intermediate
Projects
None yet
Development

No branches or pull requests

3 participants