joshuto
joshuto copied to clipboard
OOM when displaying hyperlink
(Linux, Rust 1.65, joshuto master, built from source)
When using mdcat
as a previewer, displaying some documents resulted in joshuto immediately claiming all available memory, resulting in system swapping / OOM
Some experimentation narrowed this down to documents containing a hyperlink, which mdcat
formats to be displayed in terminals
Can be reproduced by e.g. using ls --hyperlink=always
in preview_file.sh
Can you try building joshuto without syntax_highlight
feature?
Cargo.toml
...
[features]
...
default = []
Can you try building joshuto without
syntax_highlight
feature?
default = []
results in error[E0433]: failed to resolve: use of undeclared crate or module trash
default = [""devicons", "recycle_bin"" ]
builds.
The resulting binary doesn't cause OOM anymore. Preview displays raw ANSI for all files:
[0m[38;5;148mfeatures[0m[38;5;231m [0m[38;5;231m=[0m[38;5;231m [0m[38;5;231m[[0m[38;5;231m
[0m[38;5;186m"v4"[0m[38;5;231m,[0m[38;5;231m
Got it, thanks! It looks like this issue is most likely linked to ansi-to-tui, the parsing lib for providing syntax highlighting.
The solution for now is to disable this feature and create an issue on their repo