Skip to content
Myr

Exclude sysfs in find commands

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent c82fb3c · Browse files · 4 files+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+7 added−7 removed

  • other:+7 added−7 removed

4 files+7 added−7 removed

modified:shell/key-bindings.bash+2 added-2 removed
modified:shell/key-bindings.fish+2 added-2 removed
14 unmodified lines
1516 # "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not17 # $dir itself, even if hidden.18 set -q FZF_CTRL_T_COMMAND; or set -l FZF_CTRL_T_COMMAND "19 command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \19 command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \20 -o -type f -print \21 -o -type d -print \22 -o -type l -print 2> /dev/null | cut -b3-"23
29 unmodified lines
53 end5455 function fzf-cd-widget -d "Change directory"56 set -q FZF_ALT_C_COMMAND; or set -l FZF_ALT_C_COMMAND "57 command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \57 command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \58 -o -type d -print 2> /dev/null | cut -b3-"59 set -q FZF_TMUX_HEIGHT; or set FZF_TMUX_HEIGHT 40%60 begin61 set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"
26 unmodified lines
modified:shell/key-bindings.zsh+2 added-2 removed
2 unmodified lines
3if [[ $- == *i* ]]; then45# CTRL-T - Paste the selected file path(s) into the command line6__fsel() {7 local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \7 local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \8 -o -type f -print \9 -o -type d -print \10 -o -type l -print 2> /dev/null | cut -b3-"}"11 setopt localoptions pipefail 2> /dev/null
25 unmodified lines
37bindkey '^T' fzf-file-widget3839# ALT-C - cd into the selected directory40fzf-cd-widget() {41 local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \41 local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \42 -o -type d -print 2> /dev/null | cut -b3-"}"43 setopt localoptions pipefail 2> /dev/null44 local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)"45 if [[ -z "$dir" ]]; then
33 unmodified lines
modified:src/constants_unix.go+1 added-1 removed
2 unmodified lines
3package fzf45const (6 // Reader7 defaultCommand = `find -L . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`7 defaultCommand = `command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`8)