FTB - Terminal File Browser

June 26, 2026 · View on GitHub

FTB - Terminal File Browser

FTB Logo

C++17 FTXUI Linux macOS CMake

中文文档 | English

A terminal-based file browser, built with C++17 and FTXUI. Features a three-column layout (parent / current / preview), vim-like keybindings, syntax-highlighted file preview, and a rich theme system.

plmux demo

FTB operation in windows terminal(wsl2)

Features

Three-Column Layout

  • Left: Parent directory listing
  • Center: Current directory with file icons and type-based coloring
  • Right: Context-aware preview panel (file metadata, text with syntax highlighting, image rendering, directory contents)

File Operations

  • Copy (y), Cut (x), Paste (p)
  • Delete (Delete / Ctrl+D)
  • Create new file / folder (via command mode)
  • Rename (via command mode)
  • Clipboard management with visual indicator
  • Open files with default system program (Enter)
  • Configurable openers with rules-based matching (Ctrl+B → op/ow)

Vim-Like Keybindings

  • j/k or Arrow keys to navigate
  • h to go to parent directory, l to enter directory
  • / to search, Ctrl+B prefix mode for commands
  • Built-in Vim-like text editor with undo/redo, search/replace, and Markdown preview

Syntax Highlighting

  • Built-in keyword-based highlighter supporting 40+ languages (C/C++, Python, Rust, Go, Java, JavaScript, TypeScript, etc.)
  • 16 token types: keyword, string, comment, number, function, type, operator, preprocessor, and more
  • Optional tree-sitter backend for advanced parsing (build with -DFTB_ENABLE_TREE_SITTER=ON)
  • Theme-aware colors that adapt to the active theme

Image Preview

  • Renders JPG, PNG, BMP, GIF images in the terminal using Unicode half-block characters
  • Optional libchafa backend for better quality (build with -DFTB_ENABLE_LIBCHAFA=ON)

Theme System

18 built-in themes with full syntax color support:

ThemeStyleThemeStyle
defaultCatppuccin MochayaziYazi-inspired
darkHigh contrast darklightLight background
colorfulVibrant colorsminimalMonochrome
draculaDraculanordNord
tokyo-nightTokyo NightgruvboxGruvbox
solarizedSolarized Darkone-darkOne Dark
rose-pineRose PinekanagawaKanagawa
everforestEverforestmonokaiMonokai
ayuAyu DarkpoimandresPoimandres
materialMaterial DarkhorizonHorizon
melangeMelangesolarized-lightSolarized Light
............
  • Real-time theme switching via command mode (:theme)
  • JSON config file (~/.ftb) for persistent customization
  • Per-theme syntax highlighting colors

Command Mode (nvim-style)

Press Ctrl+B to enter prefix mode, then type commands:

CommandAliasAction
:theme:thOpen theme selector
:rename:rnRename selected item
:newfile:nfCreate new file
:newfolder:ndCreate new folder
:preview:pFull file preview
:details:dFolder details
:jump:jJump to directory
:vim:vOpen in Vim editor
:search:sEnter search mode
:calendar:calCalendar panel
:layout:loLayout settings
:help:hHelp panel
:plugin:plPlugin manager
:ssh-SSH connection (if enabled)
.........

Performance

  • Asynchronous file I/O for non-blocking UI
  • LRU cache for directory contents
  • Object pooling for Vim editor instances
  • Lazy loading for preview content
  • Configurable refresh intervals

Plugin System

  • TypeScript/JavaScript plugins with sandboxed execution
  • Permission-based API (fs, clipboard, env, subprocess)
  • Plugin manager panel (:plugin)
  • Auto-discovery from ~/.config/ftb/plugins/
  • Hot reload support
  • See Plugin Guide for details

Build

Dependencies

LibraryPurposeRequired
FTXUITerminal UI frameworkYes
nlohmann-jsonJSON config parsingYes
libssh2SSH connectionsNo (-DFTB_ENABLE_SSH=ON)
tree-sitterAdvanced syntax highlightingNo (-DFTB_ENABLE_TREE_SITTER=ON)
libchafaImage previewNo (-DFTB_ENABLE_LIBCHAFA=ON)
QuickJSPlugin system runtimeNo (plugins require qjs)

Install dependencies (Ubuntu/Debian)

sudo apt-get update && sudo apt-get install -y \
    libftxui-dev nlohmann-json3-dev cmake g++

Build

mkdir build && cd build
cmake ..
make -j$(nproc)

Build options

# Disable Nerd Font icons (use ASCII fallback)
cmake .. -DFTB_ENABLE_ICONS=OFF

# Enable SSH support
cmake .. -DFTB_ENABLE_SSH=ON

# Enable tree-sitter syntax highlighting
cmake .. -DFTB_ENABLE_TREE_SITTER=ON

# Enable libchafa image preview
cmake .. -DFTB_ENABLE_LIBCHAFA=ON

# Disable plugin system
cmake .. -DFTB_ENABLE_PLUGINS=OFF

# Use interactive script for building
chmod +x ./build.sh
./build.sh

Usage

# Launch in current directory
./FTB

# Launch in specific directory
./FTB /path/to/directory

# With performance logging
./FTB -l

# Specify config file
./FTB --config /path/to/config.ftb

Keybindings

KeyAction
j / DownMove down
k / UpMove up
h / LeftParent directory
l / Right / EnterEnter directory / open file with default program
/Search
Ctrl+BCommand mode
yCopy
xCut
pPaste
Delete / Ctrl+DDelete
Alt+J / Alt+KPreview scroll down / up
Alt+H / Alt+LPreview scroll left / right
Ctrl+RReload config
Ctrl+CQuit
EscapeClose panel / clear search
Home / EndJump to first / last item
PageUp / PageDownScroll pages

See Keyboard Shortcuts for the full reference.

Configuration

Copy the template and edit:

cp config/.ftb.template ~/.ftb

The config file uses JSON format. Key sections:

  • colors - UI colors (main, files, status, search, dialog, syntax)
  • style - Icons, file size, mouse support, hidden files
  • layout - Column ratios and items per page
  • theme - Active theme name
  • ssh - Default SSH port and timeout
  • bookmarks - Named directory bookmarks

See Configuration Guide for details.

Documentation

License

MIT