Skip to content

autocomplete not work after source, but works after login #2089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
gzliudan opened this issue Apr 2, 2025 · 0 comments
Open
3 tasks done

autocomplete not work after source, but works after login #2089

gzliudan opened this issue Apr 2, 2025 · 0 comments
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this

Comments

@gzliudan
Copy link

gzliudan commented Apr 2, 2025

My urfave/cli version is

v2.27.5

Checklist

  • Are you running the latest v2 release? The list of releases is here.
  • Did you check the manual for your release? The v2 manual is here
  • Did you perform a search about this problem? Here's the GitHub guide about searching.

Dependency Management

  • My project is using go modules.

Describe the bug

autocomplete not works after source, only works after login.

To reproduce

setup autocomplete according to the document:

  • copy file go/pkg/mod/github.com/urfave/cli/[email protected]/autocomplete/bash_autocomplete to ${HOME}/.bash_completion.d/xdc.sh
  • add 2 lines at the end of file .bashrc:
PROG=XDC
source ${HOME}/.bash_completion.d/xdc.sh

Then run command source .bashrc, but autocomplete does not work at this time. It does not work either after I run the above commands in terminal directly. But autocomplete works after I logout and login.

Expected behavior

autocomplete works after source, no need to relogin.

Run go version and paste its output here

go version go1.23.7 linux/amd64

OS: Ubuntu 22.04.5 LTS

Run go env and paste its output here

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/me/.cache/go-build'
GOENV='/home/me/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/me/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/me/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/home/me/govm/golang/go-1.23.7'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/me/govm/golang/go-1.23.7/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.7'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/me/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1369030031=/tmp/go-build -gno-record-gcc-switches'
@gzliudan gzliudan added area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this labels Apr 2, 2025
@gzliudan gzliudan changed the title autocomplete not work after source but works after login autocomplete not work after source, but works after login Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

1 participant