Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/internal/common/config_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ type ConfigType struct {
FilePreviewWidth int `toml:"file_preview_width" comment:"\nFile preview width allow '0' (this mean same as file panel),'x' x must be less than 10 and greater than 1 (This means that the width of the file preview will be one xth of the total width.)"`
EnableFilePreviewBorder bool `toml:"enable_file_preview_border" comment:"\nEnable border around the file preview panel (default: false)"`
CodePreviewer string `toml:"code_previewer" comment:"\nWhether to use the builtin syntax highlighting with chroma or use bat. Values: \"\" for builtin chroma, \"bat\" for bat"`
OpenFileWithDefaultApp bool `toml:"open_file_with_default_app" comment:"\nWhether pressing confirm (Enter/right/l) on a file opens it with the system default application. Set to false to disable launching external programs (e.g. open/xdg-open); the file will just be selected. Directories are still entered. (default: true)"`
SidebarWidth int `toml:"sidebar_width" comment:"\nThe length of the sidebar(excluding borders). If you don't find to display the sidebar, you can input 0 directly. If you want to display the value, please place it in the range of 5-20."`
SidebarSections []string `toml:"sidebar_sections" comment:"\nOrder of sidebar sections (valid values: \"home\", \"pinned\", \"disks\").\nOnly sections included in this list will be displayed."`

Expand Down
5 changes: 5 additions & 0 deletions src/internal/handle_panel_movement.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ func (m *model) enterPanel() {
}

func (m *model) executeOpenCommand() {
if !common.Config.OpenFileWithDefaultApp {
// User disabled launching external programs. The file is just
// selected; preview panel still shows its content.
return
}
panel := m.getFocusedFilePanel()

filePath := panel.GetFocusedItem().Location
Expand Down
8 changes: 8 additions & 0 deletions src/superfile_config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ file_preview_width = 0
# Default: false (no border)
enable_file_preview_border = false

#-- Open File With Default App
# Whether pressing confirm (Enter/right/l) on a file opens it with the
# system default application (open on macOS, xdg-open on Linux, etc.).
# Set to false to disable launching external programs; the file will just
# be selected and its preview shown. Directories are still entered.
# Default: true
open_file_with_default_app = true

#-- Sidebar Width
# If you don't want to display the sidebar, you can input 0 directly.
# Values recommended to be in 5–20.
Expand Down
Loading