lincheney / fzf-tab-completion

Tab completion using fzf
GNU General Public License v3.0
652 stars 41 forks source link

Tab completion causes pyggrep: unrecognized option '-- and a long list to be spawned in my terminal every time #92

Closed winstonpurnomo closed 6 months ago

winstonpurnomo commented 9 months ago

https://github.com/lincheney/fzf-tab-completion/assets/54757320/0b419c59-8048-45aa-bc5f-6aa9a0fa3c4d

See the screen recording.

Full text:

pyggrep: unrecognized option '--
-ftb-colorize
-ftb-fzf
-ftb-generate-header
-ftb-generate-query
_SUSEconfig
__arguments
_a2ps
_a2utils
_aap
_abcde
_absolute_command_paths
_ack
_acpi
_acpitool
_acroread
_adb
_add-zle-hook-widget
_add-zsh-hook
_alias
_aliases
_all_matches
_alsa-utils
_analyseplugin
_ansible
_ant
_antiword
_apachectl
_apm
_apt
_apt-file
_apt-move
_apt-show-versions
_aptitude
_arch_archives
_arch_namespace
_arg_compile
_arp
_arping
_arrays
_asciidoctor
_asciinema
_assign
_at
_attr
_augeas
_auto-apt
_avahi
_awk
_axi-cache
_base64
_basename
_basenc
_bash
_bash_completions
_baudrates
_baz
_be_name
_beadm
_beep
_bibtex
_bind_addresses
_bindkey
_bison
_bittorrent
_bogofilter
_bpf_filters
_bpython
_brace_parameter
_brctl
_bsd_disks
_bsd_pkg
_bsdconfig
_bsdinstall
_btrfs
_bts
_bug
_builtin
_bzip2
_bzr
_cabal
_cache_invalid
_caffeinate
_cal
_calendar
_call_function
_canonical_paths
_capabilities
_cat
_ccal
_cd
_cdbs-edit-patch
_cdcd
_cdr
_cdrdao
_cdrecord
_chattr
_chcon
_chflags
_chkconfig
_chmod
_choom
_chown
_chroot
_chrt
_chsh
_cksum
_clay
_cmdambivalent
_cmdstring
_cmp
_code
_column
_combination
_comm
_command
_comp_locale
_compadd
_compdef
_complete_debug
_complete_help
_complete_help_generic
_complete_tag
_completers
_composer
_compress
_condition
_configure
_coreadm
_correct
_correct_filename
_correct_word
_cowsay
_cp
_cpio
_cplay
_cpupower
_crontab
_cryptsetup
_cscope
_csplit
_cssh
_csup
_ctags
_ctags_tags
_cu
_curl
_cut
_cvs
_cvsup
_cygcheck
_cygpath
_cygrunsrv
_cygserver
_cygstart
_dak
_darcs
_date
_date_formats
_dates
_dbus
_dchroot
_dchroot-dsa
_dconf
_dcop
_dcut
_dd
_deb_architectures
_deb_codenames
_deb_files
_deb_packages
_debbugs_bugnumber
_debchange
_debcheckout
_debdiff
_debfoster
_deborphan
_debsign
_debsnap
_debuild
_defaults
_delimiters
_describe
_devtodo
_df
_dhclient
_dhcpinfo
_dict
_dict_words
_diff
_diff3
_diff_options
_diffstat
_dig
_dir_list
_directories
_directory_stack
_dirs
_disable
_django
_dkms
_dladm
_dlocate
_dmesg
_dmidecode
_dnf
_dns_types
_doas
_domains
_dos2unix
_dpatch-edit-patch
_dpkg
_dpkg-buildpackage
_dpkg-cross
_dpkg-repack
_dpkg_source
_dput
_drill
_dropbox
_dscverify
_dsh
_dtrace
_dtruss
_du
_dumpadm
_dumper
_dupload
_dvi
_dynamic_directory_name
_e2label
_ecasound
_echotc
_echoti
_ed
_elfdump
_elinks
_email_addresses
_emulate
_enable
_enscript
_entr
_env
_eog
_equal
_espeak
_etags
_ethtool
_evince
_exec
_expand
_expand_alias
_expand_word
_extensions
_external_pwds
_fakeroot
_fbsd_architectures
_fbsd_device_types
_fc
_feh
_fetch
_fetchmail
_ffmpeg
_figlet
_file_descriptors
_file_flags
_file_modes
_file_systems
_find
_find_net_interfaces
_findmnt
_finger
_fink
_flac
_flex
_floppy
_flowadm
_fmadm
_fmt
_fold
_fortune
_free
_freebsd-update
_fs_usage
_fsh
_fstat
_functions
_fuse_arguments
_fuse_values
_fuser
_fusermount
_fw_update
_gcc
_gcore
_gdb
_geany
_gem
_generic
_genisoimage
_getclip
_getconf
_getent
_getfacl
_getmail
_getopt
_ghostscript
_git
_git-buildpackage
_global
_global_tags
_globflags
_globqual_delims
_globquals
_gnome-gv
_gnu_generic
_gnupod
_gnutls
_go
_gpasswd
_gpg
_gphoto2
_gprof
_gqview
_gradle
_graphicsmagick
_grep
_grep-excuses
_groff
_groups
_growisofs
_gsettings
_gstat
_guard
_guilt
_gv
_gzip
_hash
_hdiutil
_head
_hexdump
_history
_history_complete_word
_history_modifiers
_host
_hostname
_hosts
_htop
_hwinfo
_iconv
_iconvconfig
_id
_ifconfig
_iftop
_imagemagick
_in_vared
_inetadm
_init_d
_initctl
_install
_invoke-rc.d
_ionice
_iostat
_ip
_ipadm
_ipfw
_ipsec
_ipset
_iptables
_irssi
_ispell
_iwconfig
_jail
_jails
_java
_java_class
_jexec
_jls
_jobs_bg
_jobs_builtin
_jobs_fg
_joe
_join
_jot
_jq
_kdeconnect
_kdump
_kfmclient
_kill
_killall
_kld
_knock
_kpartx
_ktrace
_ktrace_points
_kvno
_last
_ld_debug
_ldap
_ldconfig
_ldd
_less
_lha
_libvirt
_lighttpd
_limit
_limits
_links
_lintian
_list
_lldb
_ln
_loadkeys
_locale
_localedef
_locales
_locate
_logger
_logical_volumes
_login_classes
_look
_losetup
_lp
_ls
_lsattr
_lsblk
_lscfg
_lsdev
_lslv
_lsns
_lsof
_lspv
_lsusb
_lsvg
_ltrace
_lua
_luarocks
_lynx
_lz4
_lzop
_mac_applications
_mac_files_for_application
_madison
_mail
_mailboxes
_make
_make-kpkg
_man
_mat
_mat2
_match
_math
_math_params
_matlab
_md5sum
_mdadm
_mdfind
_mdls
_mdutil
_members
_mencal
_menu
_mere
_mergechanges
_message
_mh
_mii-tool
_mime_types
_mixerctl
_mkdir
_mkfifo
_mknod
_mkshortcut
_mktemp
_mkzsh
_module
_module-assistant
_module_math_func
_modutils
_mondo
_monotone
_moosic
_mosh
_most_recent_file
_mount
_mozilla
_mpc
_mplayer
_mt
_mtools
_mtr
_multi_parts
_mupdf
_mutt
_mv
_my_accounts
_myrepos
_mysql_utils
_mysqldiff
_nautilus
_nbsd_architectures
_ncftp
_nedit
_net_interfaces
_netcat
_netscape
_netstat
_networkmanager
_networksetup
_newsgroups
_next_tags
_nginx
_ngrep
_nice
_nkf
_nl
_nm
_nmap
_nothing
_npm
_nsenter
_nslookup
_numbers
_numfmt
_nvram
_objdump
_object_classes
_object_files
_obsd_architectures
_od
_okular
_oldlist
_open
_openstack
_opkg
_options
_options_set
_options_unset
_opustools
_osascript
_osc
_other_accounts
_otool
_pack
_pandoc
_parameter
_paste
_patch
_patchutils
_pax
_pbcopy
_pbm
_pbuilder
_pdf
_pdftk
_perf
_perforce
_perl
_perl_basepods
_perl_modules
_perldoc
_pfctl
_pfexec
_pgids
_pgrep
_php
_physical_volumes
_picocom
_pidof
_pids
_pine
_ping
_pip
_piuparts
_pkg-config
_pkg5
_pkg_instance
_pkgadd
_pkgin
_pkginfo
_pkgrm
_pkgtool
_plutil
_pmap
_pon
_portaudit
_portlint
_portmaster
_ports
_portsnap
_postfix
_postgresql
_postscript
_powerd
_pr
_precommand
_prefix
_print
_printenv
_printers
_process_names
_procstat
_prompt
_prove
_prstat
_ps
_ps1234
_pscp
_pspdf
_psutils
_ptree
_ptx
_pump
_putclip
_pv
_pwgen
_pydoc
_python_modules
_qdbus
_qemu
_qiv
_qtplay
_quilt
_rake
_ranlib
_rar
_rcctl
_rclone
_rcs
_rdesktop
_read
_read_comp
_readelf
_readlink
_readshortcut
_rebootin
_redirect
_regex_arguments
_regex_words
_remote_files
_renice
_reprepro
_retrieve_cache
_retrieve_mac_apps
_ri
_rlogin
_rm
_rmdir
_route
_routing_domains
_routing_tables
_rpm
_rrdtool
_rsync
_rubber
_ruby
_run-help
_runit
_samba
_savecore
_say
_sbuild
_sc_usage
_sccs
_sched
_schedtool
_schroot
_scl
_scons
_screen
_script
_scselect
_scutil
_seafile
_sed
_selinux_contexts
_selinux_roles
_selinux_types
_selinux_users
_sep_parts
_seq
_sequence
_service
_services
_set
_setfacl
_setopt
_setpriv
_setsid
_setxkbmap
_sh
_shasum
_showmount
_shred
_shuf
_shutdown
_signals
_signify
_sisu
_slabtop
_slrn
_smartmontools
_smit
_snoop
_socket
_sockstat
_softwareupdate
_sort
_source
_spamassassin
_split
_sqlite
_sqsh
_ss
_ssh
_ssh_hosts
_sshfs
_stat
_stdbuf
_stgit
_store_cache
_stow
_strace
_strftime
_strings
_strip
_stty
_su
_sub_commands
_sublimetext
_subscript
_subversion
_sudo
_surfraw
_svcadm
_svccfg
_svcprop
_svcs
_svcs_fmri
_svn-buildpackage
_sw_vers
_swaks
_swanctl
_swift
_sys_calls
_sysclean
_sysctl
_sysmerge
_syspatch
_sysrc
_sysstat
_systat
_system_profiler
_sysupgrade
_tac
_tail
_tar
_tar_archive
_tardy
_tcpdump
_tcpsys
_tcptraceroute
_tee
_telnet
_terminals
_tex
_texi
_texinfo
_tidy
_tiff
_tilde
_tilde_files
_time_zone
_timeout
_tin
_tla
_tload
_tmux
_todo.sh
_toilet
_toolchain-source
_top
_topgit
_totd
_touch
_tpb
_tput
_tr
_tracepath
_transmission
_trap
_trash
_tree
_truncate
_truss
_tty
_ttyctl
_ttys
_tune2fs
_twidge
_twisted
_typeset
_ulimit
_uml
_umountable
_unace
_uname
_unexpand
_unhash
_uniq
_unison
_units
_unshare
_update-alternatives
_update-rc.d
_uptime
_urls
_urpmi
_urxvt
_usbconfig
_uscan
_user_admin
_user_at_host
_user_expand
_user_math_func
_users
_users_on
_valgrind
_value
_values
_vared
_vars
_vcs_info
_vcs_info_hooks
_vi
_vim
_vim-addons
_visudo
_vmctl
_vmstat
_vnc
_volume_groups
_vorbis
_vpnc
_vserver
_w
_w3m
_wait
_wajig
_wakeup_capable_devices
_wanna-build
_watch
_watch-snoop
_wc
_webbrowser
_wget
_whereis
_which
_who
_whois
_widgets
_wiggle
_wipefs
_wpa_cli
_x_arguments
_x_borderwidth
_x_color
_x_colormapid
_x_cursor
_x_display
_x_extension
_x_font
_x_geometry
_x_keysym
_x_locale
_x_modifier
_x_name
_x_resource
_x_selection_timeout
_x_title
_x_utils
_x_visual
_x_window
_xargs
_xauth
_xautolock
_xclip
_xcode-select
_xdvi
_xfig
_xft_fonts
_xinput
_xloadimage
_xmlsoft
_xmlstarlet
_xmms2
_xmodmap
_xournal
_xpdf
_xrandr
_xscreensaver
_xset
_xt_arguments
_xt_session_id
_xterm
_xv
_xwit
_xxd
_xz
_yafc
_yast
_yodl
_yp
_yum
_zargs
_zattr
_zcalc
_zcalc_line
_zcat
_zcompile
_zdump
_zeal
_zed
_zfs
_zfs_dataset
_zfs_pool
_zftp
_zip
_zle
_zlogin
_zmodload
_zmv
_zoneadm
_zones
_zparseopts
_zpty
_zsh
_zsh-mime-handler
_zsocket
_zstyle
_ztodo
_zypper
backward-word-match
capitalize-word-match
compaudit
compdump
compinit
compinstall
down-case-word-match
forward-word-match
ftb-switch-group
ftb-tmux-popup
kill-word-match
transpose-words-match
up-case-word-match'
lincheney commented 9 months ago

Hi Can you show me the output of which grep and which ggrep

CrashTestDummy91 commented 9 months ago

same issue here

d-goncalves commented 9 months ago

Not the original author but I have the same issue

% which grep
grep: aliased to grep --color=auto
% which ggrep
ggrep not found
lincheney commented 9 months ago

Can you show me what is pyggrep and how do you install it? I tried googling and the only results were this very github issue https://www.google.com/search?q=%22pyggrep%22

Otherwise you may have to try debug this yourself by adding some set -x to the script to see where it is going wrong.

grzesuav commented 6 months ago

Encountered the same issue :

nvim grep: unrecognized option '--                                              ✔  at 23:54:33   53%  
-ftb-build-module
...
vcs_info'
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.

_fzf_completion_compadd:31: 21: bad file descriptor

I have added set -x however the output is way ahead of my understanding of zsh unfortunately - output is too big (lot of powerlevel stuff there). I just have grep, the same way as @d-goncalves aliased to --color=auto, however I commented out this alias and it did not help.

grzesuav commented 6 months ago

on the other hand, I realized I have two plugins, this one and https://github.com/Aloxaf/fzf-tab - do they suppouse to be installed one by one or just one of them ? After commenting out this one and leaving just fzf-tab it is working

grzesuav commented 6 months ago

commenting the other one and leaving this one also works, I guess issue arise when both are active?

lincheney commented 6 months ago

Thanks @grzesuav , I installed fzf-tab as well, and that has helped me manage to reproduce the issue.

I believe this commit should fix it https://github.com/lincheney/fzf-tab-completion/commit/5b8122befb172a996b92c692fe7f216de93105a4

The problem stems from fzf-tab defining a function called -- (you can check it by running declare -f -- --) (https://github.com/Aloxaf/fzf-tab/blob/bf3ef5588af6d3bf7cc60f2ad2c1c95bca216241/fzf-tab.zsh#L405) which is causing issues.

Aside: in general I would recommend not installing/enabling both this repo and https://github.com/Aloxaf/fzf-tab, as they do essentially the same thing.