jml / undistract-me

Notifies you when long-running terminal commands complete
Other
540 stars 48 forks source link

Syntax errors caused from incompatibility with fasd #59

Closed andrewfowlie closed 5 years ago

andrewfowlie commented 5 years ago

These errors occurred when install by apt install and from cloning the repo

andrew@desktop:~/repos/undistract-me$ notify_when_long_running_commands_finish_install
bash: PROMPT_COMMAND: line 7: syntax error near unexpected token `;;'
bash: PROMPT_COMMAND: line 7: `preexec_set_exit;_fasd_prompt_func;;preexec_invoke_cmd'
andrew@desktop:~/repos/undistract-me$ uname -a
Linux desktop 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
bash: PROMPT_COMMAND: line 9: syntax error near unexpected token `;;'
bash: PROMPT_COMMAND: line 9: `preexec_set_exit;_fasd_prompt_func;;preexec_invoke_cmd'
andrew@desktop:~/repos/undistract-me$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:    18.10
Codename:   cosmic
bash: PROMPT_COMMAND: line 10: syntax error near unexpected token `;;'
bash: PROMPT_COMMAND: line 10: `preexec_set_exit;_fasd_prompt_func;;preexec_invoke_cmd'

The problem appears to be that I am using fasd (https://github.com/clvv/fasd).

andrewfowlie commented 5 years ago

The solution is that I must initiate fasd after I begin undistract me. I now do it like this in my .bashrc.

# notifications for long-running terminal commands
source ~/repos/undistract-me/long-running.bash 
notify_when_long_running_commands_finish_install

# enable fasd jumps for cd and opening files
eval "$(fasd --init auto)"

If you reverse the order, you get the error messages I previously reported.