Documentation
¶
Index ¶
- Constants
- func FormatFileSize(size int64) string
- func FormatRelativeTime(timestamp int64) string
- func FormatTime(timestamp int64) string
- func GetFilePreview(path string, maxLines int) string
- func IsBinary(content []byte) bool
- func RestoreTTY(origStdoutFd int)
- func SetupTTY() (origStdoutFd int, err error)
Constants ¶
View Source
const ( // BinaryDetectionBytes is the number of bytes to read for binary detection BinaryDetectionBytes = 8192 // MaxPreviewLines is the maximum number of lines to show in file preview MaxPreviewLines = 50 // MaxLineLength is the maximum character length for a single line MaxLineLength = 120 // MaxDirectoryEntries is the maximum number of directory entries to show MaxDirectoryEntries = 20 // HistoryContextLinesBefore is the number of history context lines before HistoryContextLinesBefore = 3 // HistoryContextLinesAfter is the number of history context lines after HistoryContextLinesAfter = 4 )
Binary detection and preview constants
Variables ¶
This section is empty.
Functions ¶
func FormatFileSize ¶
FormatFileSize formats a file size in bytes to a human-readable string
func FormatRelativeTime ¶
FormatRelativeTime formats a Unix timestamp as a human-readable relative time
func FormatTime ¶
FormatTime formats a Unix timestamp as YYYY-MM-DD HH:MM:SS
func GetFilePreview ¶
GetFilePreview returns a preview of the file contents
func RestoreTTY ¶
func RestoreTTY(origStdoutFd int)
RestoreTTY restores stdout to the original file descriptor
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.