chromebrew / chromebrew

Package manager for Chrome OS
https://chromebrew.github.io
GNU General Public License v3.0
2.27k stars 373 forks source link

Auto-Completion is not working by default #1731

Open VitaliyKulikov opened 6 years ago

VitaliyKulikov commented 6 years ago

Description

Auto-Completion is not working by default even after installing bash_completion.

Then I typed crew in shell I would like to hit tab and see all possible command NOT files. Same, for : git, maven, etc.

Versions and system information

chromebrew: 0.4.3

ChromeOS:

CHROMEOS_ARC_ANDROID_SDK_VERSION=25
CHROMEOS_ARC_VERSION=4524559
CHROMEOS_AUSERVER=https://tools.google.com/service/update2
CHROMEOS_BOARD_APPID={01906EA2-3EB2-41F1-8F62-F0B7120EFD2E}
CHROMEOS_CANARY_APPID={90F229CE-83E2-4FAF-8479-E368A34938B1}
CHROMEOS_DEVSERVER=
CHROMEOS_RELEASE_APPID={01906EA2-3EB2-41F1-8F62-F0B7120EFD2E}
CHROMEOS_RELEASE_BOARD=eve-signed-mpkeys
CHROMEOS_RELEASE_BRANCH_NUMBER=86
CHROMEOS_RELEASE_BUILDER_PATH=eve-release/R63-10032.86.0
CHROMEOS_RELEASE_BUILD_NUMBER=10032
CHROMEOS_RELEASE_BUILD_TYPE=Official Build
CHROMEOS_RELEASE_CHROME_MILESTONE=63
CHROMEOS_RELEASE_DESCRIPTION=10032.86.0 (Official Build) stable-channel eve 
CHROMEOS_RELEASE_NAME=Chrome OS
CHROMEOS_RELEASE_PATCH_NUMBER=0
CHROMEOS_RELEASE_TRACK=stable-channel
CHROMEOS_RELEASE_VERSION=10032.86.0
DEVICETYPE=CHROMEBOOK
GOOGLE_RELEASE=10032.86.0

Model: Google Pixelbook

Architecture:

Linux localhost 4.4.86-11979-g09b49365a3c4 #1 SMP PREEMPT Mon Jan 8 23:19:25 PST 2018 x86_64 Intel(R) Core(TM) i5-7Y57 CPU @ 1.20GHz GenuineIntel GNU/Linux
beliefless-dogmasless commented 6 years ago

Honestly, I do not use crosh but Bash, I do not have any problems with completion. To replace crosh by bash: cd /usr/bin;sudo sed -i.bak '' crosh;sudo sed -i '$ i exec /bin/bash --login "$@"' crosh

VitaliyKulikov commented 6 years ago

@beliefless-dogmasless i would like too.. )) but,

crosh> shell
chronos@localhost / $ cd /usr/bin;sudo sed -i.bak '' crosh;sudo sed -i '$ i exec /bin/bash --login "$@"' crosh
sed: couldn't open temporary file ./sed2oHEu4: Read-only file system
sed: couldn't open temporary file ./seddh7BK7: Read-only file system
beliefless-dogmasless commented 6 years ago

You need Before being in Developer Mode, then make the partition rw: In the terminal: cd /usr/share/vboot/bin/;sudo ./make_dev_ssd.sh then depending on the result (--partitions 2 ou 4) cd /usr/share/vboot/bin/;sudo ./make_dev_ssd.sh --remove_rootfs_verification --partitions 2;sudo reboot or cd /usr/share/vboot/bin/;sudo ./make_dev_ssd.sh --remove_rootfs_verification --partitions 4;sudo reboot ,you have to do this again at each update of the system

uberhacker commented 6 years ago

@beliefless-dogmasless: Unless I'm mistaken, I think @VitaliyKulikov wants auto-completion for crew commands and not just bash. Correct me if I'm wrong @VitaliyKulikov.

uberhacker commented 6 years ago

@VitaliyKulikov: There are instructions in the postinstall section of the git package that explain how you can get auto-completion working.

VitaliyKulikov commented 6 years ago

@beliefless-dogmasless thanks, i will try. btw: any drawbacks to partition rw mounting?

VitaliyKulikov commented 6 years ago

@uberhacker hmm, i will say for bash only is ok )) not necessary for crew. but, any chance to have auto-completion without https://github.com/skycocker/chromebrew/issues/1731#issuecomment-363394572 steps?

uberhacker commented 6 years ago

I don't have an answer. I will need to look into it further but I'm thinking initially that an rw mount is not necessary.

skiman6010 commented 6 years ago

This is the command that @uberhacker is talking about in the git package.

if [ -f /usr/local/share/git-completion/git-completion.bash ]; then
  source /usr/local/share/git-completion/git-completion.bash
fi

You just add that to your .bashrc for git completion.

beliefless-dogmasless commented 6 years ago

@VitaliyKulikov: "any drawbacks to partition rw mounting?" Not really, anyway, at each update of the system, it is necessary to restart the manipulation, on crosh, and rw for the system. unless, I think, to open the box, and to do some 'speleology' to 'remove a security screw' I believe on the bios.

VitaliyKulikov commented 6 years ago

@uberhacker can we create expanded ~/.bashrc by default or create some package that update rc file with fancy stuff? ))

note: like ubuntu have or others

beliefless-dogmasless commented 6 years ago

If the system is rw, you can do anything, from /etc/bash/bashrc but, it's the same with every update, you have to add what you want to bashrc, because it is set to 'zero' by default. Personally, I use a script, which makes me all these operations, at each update.

skiman6010 commented 6 years ago

@VitaliyKulikov I throw mine in a folder called dotfiles then symlink it. I also have it on GitHub. It's basic, but feel free to look through it for stuff. https://github.com/skiman6010/dotfiles/blob/master/.bashrc

uberhacker commented 6 years ago

The problem with a "default" ~/.bashrc is every user has their own "preferences". It would be nice if each package could detect which shell is active and configure automagically but that is a Pandora's box to open.

cstrouse commented 4 years ago

Here's a WIP bash autocomplete script (https://gist.github.com/cstrouse/8e13a7008ebfef49f335d05bb4212409) that you can modify to do what you'd like. This was my first attempt at figuring out bash autocompletion so it's not quite what I was after and needs work.

Zopolis4 commented 6 days ago

This should be handled by crew_profile_base by now, right?