1 parent
2cd4ba016a
commit
39da022fcc
5 files changed
+13
-8
No files matched your search
@@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
- The client server connection will now exclusively use Unix domain sockets on Windows and no longer fall back to TCP sockets (#2527).
|
||||
- The fallback location of the server socket (used if `XDG_RUNTIME_DIR` is not defined) is changed from `/tmp/lf.<user>.sock` to `/tmp/lf-<uid>/lf.sock`, and the containing directory must be owned by the current user (#2532).
|
||||
- The `ignorecase` and `ignoredia` options (intended for searching) no longer affect sorting, and instead `sortignorecase` and `sortignoredia` have been added to customize sorting (#2543).
|
||||
- Previews are now marked as binary if they contain a control character other than bell, backspace, tab, newline, vertical tab, form feed, carriage return, escape or delete (#2561). Previously only null bytes were used to detect binary previews.
|
||||
|
||||
### Added
|
||||
|
||||
@@ -47,6 +48,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
- The number of bytes read is now limited for previews that contain extremely long lines (#2458).
|
||||
- Control characters are now stripped from previews to prevent dangerous terminal sequences from being processed if the default previewer is used (#2459).
|
||||
- Sixel images with the same height as the preview window are now displayed correctly when using `tmux` (#2474).
|
||||
- A bug where previews were loaded according to the old dimensions of the preview window following a terminal resize is now fixed (#2491).
|
||||
- Completion matches are now properly aligned if they contain terminal sequences (#2511).
|
||||
- `load` commands are now processed when the `watch` option is enabled, which should fix various issues with refreshing updated files/directories (#2513).
|
||||
- Parsing octal values in strings are now restricted to numbers between `0` and `255` (#2516).
|
||||
|
||||
@@ -1077,7 +1077,7 @@ Note that preserving other attributes like ownership of change/birth timestamp i
|
||||
|
||||
Show previews of files and directories at the rightmost pane.
|
||||
If the file has more lines than the preview pane, the rest of the lines are not read.
|
||||
Files are considered binary and displayed as `binary` if the read portion contains a control character other than tab, newline, vertical tab, form feed, carriage return, backspace, or escape.
|
||||
Files are considered binary and displayed as `binary` if the read portion contains a control character other than bell, backspace, tab, newline, vertical tab, form feed, carriage return, escape or delete.
|
||||
|
||||
## previewer (string) (default ``) (not filtered if empty)
|
||||
|
||||
|
||||
@@ -1167,8 +1167,9 @@ preview (bool) (default true)
|
||||
|
||||
Show previews of files and directories at the rightmost pane. If the
|
||||
file has more lines than the preview pane, the rest of the lines are not
|
||||
read. Files containing the null character (U+0000) in the read portion
|
||||
are considered binary files and displayed as binary.
|
||||
read. Files are considered binary and displayed as binary if the read
|
||||
portion contains a control character other than bell, backspace, tab,
|
||||
newline, vertical tab, form feed, carriage return, escape or delete.
|
||||
|
||||
previewer (string) (default ``) (not filtered if empty)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Automatically generated by Pandoc 3.7.0.2
|
||||
.\"
|
||||
.TH "LF" "1" "2026\-05\-02" "r42" "DOCUMENTATION"
|
||||
.TH "LF" "1" "2026\-05\-15" "r42" "DOCUMENTATION"
|
||||
.SH NAME
|
||||
lf \- terminal file manager
|
||||
.SH SYNOPSIS
|
||||
@@ -1031,8 +1031,10 @@ timestamp is desirable, but not portably supported in Go.
|
||||
Show previews of files and directories at the rightmost pane.
|
||||
If the file has more lines than the preview pane, the rest of the lines
|
||||
are not read.
|
||||
Files containing the null character (U+0000) in the read portion are
|
||||
considered binary files and displayed as \f[CR]binary\f[R].
|
||||
Files are considered binary and displayed as \f[CR]binary\f[R] if the
|
||||
read portion contains a control character other than bell, backspace,
|
||||
tab, newline, vertical tab, form feed, carriage return, escape or
|
||||
delete.
|
||||
.SS previewer (string) (default \(ga\(ga) (not filtered if empty)
|
||||
Set the path of a previewer file to filter the content of regular files
|
||||
for previewing.
|
||||
|
||||
@@ -466,7 +466,7 @@ func deletePathRecursive[T any](m map[string]T, path string) {
|
||||
// Individual lines are truncated to avoid unbounded memory usage on files
|
||||
// with very long or no newlines.
|
||||
// Sixel images are also detected and stored as separate lines.
|
||||
// The presence of a null byte outside a sixel image indicates a binary file.
|
||||
// C0 control bytes outside of \a \b \t \n \v \f \r \033 and DEL indicate binary content.
|
||||
func readLines(reader io.ByteReader, maxLines int) (lines []string, binary bool, sixel bool) {
|
||||
const maxLineBytes = 1 << 16 // 64 KiB per line
|
||||
|
||||
@@ -500,7 +500,7 @@ func readLines(reader io.ByteReader, maxLines int) (lines []string, binary bool,
|
||||
|
||||
switch currState {
|
||||
case stateNormal:
|
||||
// C0 controls outside \b \t \n \v \f \r \033 and DEL indicate binary content.
|
||||
// C0 control bytes outside of \a \b \t \n \v \f \r \033 and DEL indicate binary content.
|
||||
if b < 0x07 || (b > 0x0D && b < 0x1B) || (b > 0x1B && b < 0x20) || b == 0x7F {
|
||||
return nil, true, false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user