Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2930

Issues setting up bash autocomplete for Python3 alias

$
0
0

I've got an alias for python3, 'py' - it's set up as you might expect in my .bashrc file.

alias py='python3'complete -F _python py

The issue is that complete will only work if I try to complete with the base python command python prior. Here's an example in the terminal log below:

~/askubuntodemo: ls                           main.py~/askubuntodemo: py -bash: completion: function `_python' not found~/askubuntodemo: python main.pyhello world~/askubuntodemo: py main.pyhello world

Is there a way I can initialise the autocomplete as soon as I log in as opposed to having to manually initiallise by doing a complete with the main python complete first.

(edit: for error in .bashrc while posting)


Viewing all articles
Browse latest Browse all 2930

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>