Skip to content
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

Improve the instructions for "See what you’re 'doing' in the iTerm status bar" #130

Closed
soto97 opened this issue Dec 7, 2021 · 1 comment
Assignees

Comments

@soto97
Copy link

soto97 commented Dec 7, 2021

Is your feature request related to a problem? Please describe.

I was following the instructions to setup the doing status in the iTerm status bar, but it was difficult to get to work because one key detail was missing from the instructions. Basically, the status bar wasn't updating properly because the instructions where not clear, to me, on how to add `iterm2_set_user_var' to the prompt display.

In the instructions, it says:

Now we need a way to refresh the variable. I chose to do it with a prompt command, 
running every time the prompt displays. Since all it’s going to do is cat a tiny 
text file, there’s no performance hit. I suppose you could set up some kind of 
polling, but this seems like the best solution.

These examples use functions created by the iTerm shell integration. If you haven’t 
already, go to iTerm->Install Shell Integration to add the tools to your current shell.

In a fish_prompt function:
    iterm2_set_user_var doingNow (command cat ~/.doing_cache)

Or in a bash prompt_command:
    iterm2_set_user_var doingNow "$(command cat ~/.doing_cache)"

Unfortunately, for me, it was not immediately obvious how to add this to the prompt in a way that it would be properly triggered. Ultimately, here's what I found that I need to add, using bash:

PROMPT_COMMAND='iterm2_set_user_var doingNow "$(command cat ~/.doing_cache)"

I put this before the command where I invoke the prompt, i.e., PS1=... Once I did this, everything worked smoothly.

Describe the solution you'd like

I suggest/request/whatever-is-the-nicest-way-to-ask that you update your instructions to show explicitly how the iterm2_set_user_var is set in Bash through the use of the PROMPT_COMMAND syntax. (And maybe do the same for fish? I have no idea -- I have never used fish).

Additional context
Maybe this is related to issue #123?

Most importantly, thanks for this awesome tool!

soto97 added a commit to soto97/dotfiles that referenced this issue Dec 7, 2021
I followed these instructions:
https://brettterpstra.com/2021/10/15/see-what-youre-doing-in-the-iterm-status-bar/

With the hooks mod from here:
ttscoff/doing#123
https://github.com/ttscoff/doing/wiki/Hooks

And my fix from here:
ttscoff/doing#130

 On branch main
 Your branch is ahead of 'origin/main' by 3 commits.
   (use "git push" to publish your local commits)

 Changes to be committed:
	modified:   bash_prompt
@soto97
Copy link
Author

soto97 commented Jan 3, 2022

On further thought, I am going to close this. I may write my own blog post to share this tip and then link it back here, but I don't need to nor should be asking @ttscoff to do anything about this.

Thanks.

@soto97 soto97 closed this as completed Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants