tech superfile ubuntu tmux terminal tui
Table of contents
- Introduction
- Install Superfile
- Dependencies Opsional
- Konfigurasi Dasar
- Integrasi Tmux — Truecolor & COLORTERM
- cd on Quit — Wrapper spf() di Bash
- Font & Rendering
- Rekomendasi config.toml
- Verifikasi Setup
- Troubleshooting
- Referensi
Introduction
superfile adalah terminal file manager modern (Go + Bubble Tea) dengan UI rapi, multi-panel, preview file, dan 20+ tema built-in. Catatan ini mencakup setup lengkap di Ubuntu 24.04, termasuk integrasi dengan tmux agar warna truecolor tampil benar.
Hotkey lengkap ada di → Superfile Hotkeys
Install Superfile
Metode 1: Install script (recommended)
bash -c "$(curl -sLo- https://superfile.dev/install.sh)"Setelah selesai, jalankan:
spfBinary biasanya terpasang di ~/.local/bin/spf. Pastikan path ini ada di PATH:
export PATH="$HOME/.local/bin:$PATH"Metode 2: Go install
go install github.com/yorukot/superfile@latestPath konfigurasi (Linux)
| Item | Path |
|---|---|
| Config utama | ~/.config/superfile/config.toml |
| Hotkeys | ~/.config/superfile/hotkeys.toml |
| Theme | ~/.config/superfile/theme/ |
| Data | ~/.local/share/superfile |
| Log | ~/.local/state/superfile/superfile.log |
| State (cd on quit) | ~/.local/state/superfile/lastdir |
Edit config:
nano ~/.config/superfile/config.tomlDependencies Opsional
| Paket | Fungsi di superfile |
|---|---|
| Nerd Font | Icon file & folder (nerdfont = true) |
bat | Syntax highlighting preview kode |
exiftool | Metadata detail (metadata = true) |
zoxide | Navigasi cepat via modal z |
unzip / p7zip | Extract archive |
zip | Compress ke .zip |
Install contoh:
sudo apt update
sudo apt install bat exiftool unzip zipInstall zoxide (opsional):
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | shKonfigurasi Dasar
Pertama kali jalanin spf, config default otomatis dibuat. Beberapa setting penting:
# ~/.config/superfile/config.toml
theme = "catppuccin-mocha" # ganti sesuai selera
default_directory = "." # folder awal saat buka spf
cd_on_quit = true # wajib true kalau mau cd_quit (Q) & wrapper spf()
default_open_file_preview = true
show_image_preview = true
nerdfont = true # butuh Nerd Font di terminalTema tersedia: catppuccin-mocha, tokyonight, dracula, gruvbox, nord, dll. Lihat Theme List.
Integrasi Tmux — Truecolor & COLORTERM
superfile (base Go/Bubble Tea) ngecek COLORTERM, bukan cuma $TERM. Di dalam tmux, COLORTERM sering nggak ke-pass ke pane child — ini sumber masalah warna hitam-putih / pucat paling sering.
Setup minimal (yang paling penting)
1. Export COLORTERM di shell — tambahkan ke ~/.bashrc (sebelum masuk tmux):
export COLORTERM=truecolor2. Pass COLORTERM ke pane tmux — tambahkan ke ~/.tmux.conf:
set -ga update-environment "COLORTERM"Ini yang sering kelewat. Tanpa baris ini,
COLORTERMbisa kosong di dalam tmux meskipun udah di-export di.bashrc.
Setup tambahan (recommended)
Kalau warna masih aneh setelah setup minimal di atas, tambahkan juga:
# Terminal default di dalam tmux
set -g default-terminal "tmux-256color"
# tmux 3.3+ — aktifkan RGB/truecolor
set -as terminal-features ",*:RGB"
# Fallback tmux lama (< 3.3), ganti XXX dengan $TERM di LUAR tmux:
# set -as terminal-overrides ",xterm-256color:Tc"Verifikasi
# Di LUAR tmux
echo $COLORTERM # harus: truecolor
# Di DALAM tmux (buka pane baru setelah reload config)
echo $COLORTERM # harus: truecolor (bukan kosong!)
echo $TERM # biasanya: tmux-256colorReload tmux
tmux source-file ~/.tmux.confLalu buka sesi tmux baru — attach ke sesi lama kadang masih pakai env lama.
Ringkasan
| Setting | Di mana | Fungsi |
|---|---|---|
export COLORTERM=truecolor | ~/.bashrc | Kasih tau app TUI bahwa terminal support 24-bit |
set -ga update-environment "COLORTERM" | ~/.tmux.conf | Wajib — tmux nerusin COLORTERM ke pane child |
default-terminal "tmux-256color" | ~/.tmux.conf | TERM yang benar di dalam tmux |
terminal-features ",*:RGB" | ~/.tmux.conf | tmux nerusin capability RGB ke app child |
cd on Quit — Wrapper spf() di Bash
Agar cd_on_quit dan hotkey Q (cd_quit) bekerja, superfile butuh wrapper function di shell — bukan langsung panggil binary spf.
1. Aktifkan di config
cd_on_quit = true2. Tambahkan wrapper ke ~/.bashrc
spf() {
os=$(uname -s)
if [[ "$os" == "Linux" ]]; then
export SPF_LAST_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/superfile/lastdir"
fi
if [[ "$os" == "Darwin" ]]; then
export SPF_LAST_DIR="$HOME/Library/Application Support/superfile/lastdir"
fi
command spf "$@"
[ ! -f "$SPF_LAST_DIR" ] || {
. "$SPF_LAST_DIR"
rm -f -- "$SPF_LAST_DIR" > /dev/null
}
}3. Reload bashrc
source ~/.bashrcSekarang:
- Keluar normal → shell tetap di folder semula
- Tekan
Q(shift+q) → shellcdke folder terakhir di file panel
Font & Rendering
Nerd Font
Icon superfile butuh font yang sudah di-patch Nerd Font.
- Download font (contoh: JetBrainsMono Nerd Font)
- Install ke
~/.local/share/fonts/ - Set font tersebut di terminal emulator (GNOME Terminal, Kitty, Alacritty, dll)
- Pastikan
nerdfont = truedi config
Locale UTF-8
localePastikan output mengandung UTF-8. Kalau belum:
sudo localectl set-locale LANG=en_US.UTF-8
# atau
sudo localectl set-locale LANG=id_ID.UTF-8Rendering rusak (karakter aneh / layout pecah)
Tambahkan ke ~/.bashrc:
export RUNEWIDTH_EASTASIAN=0Rekomendasi config.toml
Contoh config yang nyaman dipakai sehari-hari di Ubuntu + tmux:
##############################################
# Superfile Configuration #
##############################################
editor = "" # pakai $EDITOR (nvim, code, dll)
cd_on_quit = true
auto_check_update = true
default_open_file_preview = true
show_image_preview = true
show_panel_footer_info = true
default_directory = "."
file_size_use_si = false
default_sort_type = 4 # Natural sort (file2 sebelum file10)
sort_order_reversed = false
case_sensitive_sort = false
theme = "catppuccin-mocha"
code_previewer = "bat" # butuh bat terinstall
nerdfont = true
show_select_icons = true
transparent_background = false
file_preview_width = 2
enable_file_preview_border = true
sidebar_width = 20
sidebar_sections = ["home", "pinned", "disks"]
# Plugins
metadata = false # true kalau exiftool terinstall
zoxide_support = true # true kalau zoxide terinstall
[open_with]
md = "nvim"
json = "nvim"
conf = "nvim"Custom hotkey (vim user):
nano ~/.config/superfile/hotkeys.tomlLihat Custom Hotkeys.
Verifikasi Setup
Jalankan checklist ini setelah setup:
# 1. Binary ada
which spf
# 2. COLORTERM ter-set (di luar DAN di dalam tmux)
echo $COLORTERM # harus: truecolor atau 24bit
# 3. Di dalam tmux, cek lagi
tmux new-session -d -s spf-test 'echo "TERM=$TERM COLORTERM=$COLORTERM" > /tmp/tmux-env.txt'
cat /tmp/tmux-env.txt # COLORTERM harus truecolor, TERM biasanya tmux-256color
tmux kill-session -t spf-test
# 4. Locale UTF-8
locale | grep UTF-8
# 5. Jalankan superfile
spfDi dalam superfile:
- Tekan
?→ help menu muncul - Tekan
f→ preview panel toggle - Tekan
Q→ keluar + cd ke folder aktif (kalau wrapper sudah diset)
Troubleshooting
Icon tidak tampil / kotak kosong
- Install & apply Nerd Font di terminal
- Atau set
nerdfont = falsedi config (tanpa icon)
Warna pucat / hitam-putih di tmux
Langkah 1 — cek COLORTERM di dalam tmux:
echo $COLORTERMHarusnya keluar truecolor atau 24bit. Kalau kosong:
# ~/.bashrc
export COLORTERM=truecolor
# ~/.tmux.conf
set -ga update-environment "COLORTERM"Reload, lalu buka sesi tmux baru.
Langkah 2 — isolasi masalah: tema vs environment
Edit ~/.config/superfile/config.toml, ganti ke tema default:
theme = "gruvbox"Buka spf lagi:
- Warna normal → masalahnya di file tema custom (rusak/format salah)
- Tetap hitam-putih → masalahnya di environment/tmux, bukan file tema
Langkah 3 — cek file tema (kalau langkah 2 nunjuk ke tema):
cat ~/.config/superfile/theme/tokyonight.tomlPastikan isinya lengkap ada field warna (format hex #xxxxxx). Bandingkan strukturnya dengan tema bawaan yang jalan:
diff ~/.config/superfile/theme/tokyonight.toml ~/.config/superfile/theme/gruvbox.tomlLangkah 4 — cek versi superfile:
spf -vTema custom kadang butuh struktur tertentu sesuai versi superfile. Update kalau perlu:
bash -c "$(curl -sLo- https://superfile.dev/install.sh)"Langkah 5 — kalau masih aneh, tambahkan RGB di tmux:
set -g default-terminal "tmux-256color"
set -as terminal-features ",*:RGB"cd_quit (Q) tidak mengubah direktori shell
- Pastikan
cd_on_quit = truedi config - Pastikan pakai function
spf(), bukan binary langsung - Reload:
source ~/.bashrc
Rendering berantakan
- Set locale UTF-8
- Tambah
export RUNEWIDTH_EASTASIAN=0 - Jangan override
TERMke value yang nggak support color
Konflik hotkey dengan vim/nvim
- Ganti preset hotkey ke versi vim di
hotkeys.toml - Lihat peringatan di GitHub superfile
Log error
cat ~/.local/state/superfile/superfile.logReferensi
- superfile — Official Site
- Installation
- Config
- Hotkey List → Superfile Hotkeys
- Theme List
- Troubleshooting
- install tmux for ubuntu — setup tmux dasar
- support highlight copas tmux — clipboard di tmux