Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

.tmc-autocomplete.sh should store opts on the disk instead of running tmc #389

Open
jclc opened this issue Aug 16, 2016 · 5 comments
Open
Assignees

Comments

@jclc
Copy link
Contributor

jclc commented Aug 16, 2016

source $HOME/.tmc-autocomplete.sh makes starting a new shell take up several seconds. Running the JVM every time you start a shell is not a good idea at all.

@jclc jclc changed the title sourcing .tmc-autocomplete.sh in rc file slows shell startup .tmc-autocomplete.sh should store opts on the disk instead of running tmc Aug 16, 2016
@jclc
Copy link
Contributor Author

jclc commented Aug 16, 2016

Also, if tmc is not found, the script hangs and you won't be able to run the shell at all.

@Salmela
Copy link
Contributor

Salmela commented Aug 19, 2016

The problem most likely is that the tmc tries to auto update. It was fixed in commit 214f880 .

@Salmela
Copy link
Contributor

Salmela commented Aug 19, 2016

If the tmc doesn't exist. The bash script prints the following on my machine.
bash: ~/tmc-cli/tmc: No such file or directory

I think we should hide any error messages from the auto-completion code.
The shell could die due to the strict mode set in your rc file. A workaround for this should be added into the launch script.

@Salmela Salmela added bug and removed enhancement labels Aug 19, 2016
@jclc
Copy link
Contributor Author

jclc commented Aug 19, 2016

Yes, that seems to have been fixed in the master branch - I was using the latest release. Might be a good idea to draft a new one.

That being said, even with the latest version tmc still adds a short but noticeable delay when starting a new shell. Probably no big deal for anyone with a sufficiently powerful machine, but I think it would still be best if .tmc-autocomplete didn't run any Java code. Users with toasters may end up having to wait a few seconds. I keep the source line in my .bashrc commented when I'm not actively using it to speed it up.

@Salmela
Copy link
Contributor

Salmela commented Aug 20, 2016

Yeah It's probably pretty easy to just dump the new commands into a file in the auto-update code. I will look into it.

@Salmela Salmela self-assigned this Aug 20, 2016
@Salmela Salmela added enhancement and removed bug labels Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants