Discover Packages
github.com/xyproto/megafile
package
module
Version:
v1.2.5
Opens a new window with list of versions in this module.
Published: Dec 18, 2025
License: BSD-3-Clause
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
README
¶
MegaFile
A simple and colorful TUI shell for Linux, written in Go.
This project can be used as the github.com/xyproto/megafile package, or as a standalone exectuable.
(screenshot of the previous version, before the project rename)
Building
make
Installation
make install
Commands
any filename - edit file with $EDITOR
cd, .. or any directory name - change directory
./script.sh - execute a script named script.sh
ls or dir list directory (happens automatically, though)
q, quit or exit - exit program
Hotkeys
Navigation and Selection
↑/↓/←/→ - navigate and select files
Page Up/Down - jump to first/last entry in current column
Home or ctrl-a - jump to first file (or start of line when typing)
End or ctrl-e - jump to last file (or end of line when typing)
Execution
Return - execute selected file, or run typed command
Esc - clear selection (first press), exit program (second press)
Text Editing
Backspace - delete character, or go up directory (when at start)
ctrl-h - delete character, or toggle hidden files (when at start)
ctrl-d - delete character under cursor, or exit program
ctrl-k - delete text to the end of the line
ctrl-c - clear text, or exit program
File Operations
Tab - cycle through files, or tab completion
ctrl-f - search for text in files
Directory Navigation
ctrl-space - enter the most recent subdirectory
ctrl-n - cycle to next directory
ctrl-p - cycle to previous directory
ctrl-b - go to parent directory
Display
ctrl-o - toggle show hidden files
ctrl-l - clear screen
External Tools
ctrl-t - run tig
ctrl-g - run lazygit
Exit
ctrl-q - exit program immediately
General info
Expand ▾
Collapse ▴
Documentation
¶
Package megafile provides functionality for a simple TUI for browsing files and directories
ErrExit is the error that is returned if the user appeared to want to exit
Cleanup tries to set everything right in the terminal emulator before returning
MegaFile launches a file browser
c and tty is a canvas and TTY, initiated with the vt package
startdirs is a slice of directories to browse (toggle with tab)
startMessage is the string to display at the top of the screen
the function returns the absolute path to the directory the user ended up in,
and an error if something went wrong
type FileEntry struct {
}
FileEntry represents a file entry with position and name information
State holds the current state of the shell, then canvas and the directory structures
Source Files
¶
Directories
¶
cmd
megafile
command
package main is the main package for the MegaFile program
package main is the main package for the MegaFile program
Click to show internal directories.
Click to hide internal directories.