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

Feature request: Activity indicator on tab title #2515

Closed
tanertas opened this issue Apr 7, 2020 · 13 comments
Closed

Feature request: Activity indicator on tab title #2515

tanertas opened this issue Apr 7, 2020 · 13 comments

Comments

@tanertas
Copy link

tanertas commented Apr 7, 2020

Doesn't it going to be useful if we have have some sort of activity monitor on tab titles? If buffer in a passive tab changes due to a finished job or a new log message, this tab's title can be marked in such a way like how we define separators.

For example we run "tail -f /var/log/messages" on Tab-2 but active tab is Tab-4. When an event occurs on Tab-2, an indicator can be used to notice user. This indicator can be color scheme or a character.

Can be configured in such way:
activity_caharacter "*"
tab_title_template " {activity}{index}{activity} "

| 1 | 2 | 3 |.4.|
| 1 |*2*| 3 |.4.|

If there is a solution for this, I appreciate to know about it,

@tanertas tanertas changed the title Feature request: Activity monitoring on tab title Feature request: Activity indicator on tab title Apr 7, 2020
@kovidgoyal
Copy link
Owner

If what you want to do is watch a file for changes, use inotifywatch
and have it change the title using either kitty remote control or the
standard escapes to set terminal titles which work across all terminals.

@kovidgoyal
Copy link
Owner

Or just have inotifywatch run printf '\a' which will add a bell icon to the tab in kitty

@tanertas
Copy link
Author

tanertas commented Apr 8, 2020

If what you want to do is watch a file for changes..

No. I think you didn't get what I'm trying to tell at all. I'm trying to get notified about any single change on terminal output regardless running any application since last view/visit of that tab.

@kovidgoyal
Copy link
Owner

kovidgoyal commented Apr 8, 2020 via email

@tanertas
Copy link
Author

tanertas commented Apr 8, 2020

Why? Because I need it and it is very useful feature.

Your inotify advice is entirely out of context. I'm here because I want to do it natively with the terminal app that I'm using regardless any app/command running or any type of output generated on terminal. You don't always dealing with files when using shell, right?

I hope you will not advice to redirect app/command output to a file every time in order to get notified with inotifywatch.

@kovidgoyal
Copy link
Owner

kovidgoyal commented Apr 8, 2020 via email

@tanertas
Copy link
Author

tanertas commented Apr 9, 2020

On Tue, Apr 07, 2020 at 11:14:57PM -0700, tanertas wrote: Why? Because I need it and it is very useful feature.
You are asking me to spend my time implementing and then maintaining a feature for YOU. The least you can bother to do is spell out a use case for it. Since you haven't I am not going to bother implementing it for you either.

You asked me my reason and I told my reason. This doesn't mean my request only relates with my personal interests. Some other people may need it and find it useful as mine. I already give enough info for use case for it.

Btw, I made it using tmux with .tmux.conf below. I'm putting here in case of anyone else need such feature. It provides similar behavior as tabbed urxvt which I was trying to achieve.

set -g visual-activity off
setw -g monitor-activity on
set -g base-index 1
setw -g pane-base-index 1

bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
bind -n C-left swap-window -t -1\; select-window -t -1
bind -n C-right swap-window -t +1\; select-window -t +1

@triamazikamno
Copy link

It is indeed a very useful feature. There are multiple use cases where inotify is not an option: tailing a log or waiting for something to happen in the ssh session, building a docker image with some slow step that you would want to know as soon as it's through, tailing a log from docker container or from kubernetes cluster via kubectl, and so on.
Is there any chance to get it implemented natively?

@kovidgoyal
Copy link
Owner

tail -f /var/log/system.log | sed $'s/$/\a/'

@triamazikamno
Copy link

Nice trick, but not everything is sent to stdout... And if you are working in different environments with random shells over ssh, it will be tedious to figure out which notation to use to redirect stderr every time.
Typing it in and remembering to do so also doesn't sound like fun, when you need it on almost every command :)

I love how fast the app is, so refreshing after the iterm2 sluggishness. But the activity indicator on the tab became such an important part of the workflow for me, especially when I work with a lot of tabs. Sounds like a small thing, but it makes a big difference :)

@tanertas
Copy link
Author

tanertas commented Sep 4, 2020

I tried to tell same things... btw, since I started to use tmux, i think it is a better solution since you can continue to use every opened shell window even if you logged out desktop session. Only drawback is you have to find a good configuration in order to properly browse on text buffer.

@kovidgoyal kovidgoyal reopened this Sep 8, 2020
@securisec
Copy link

@tanertas I came across this also today, and solved it with the following:

source this function:

output_alert() {
    local line
    while IFS= read -r line; do
        printf '%s\n\a' "$line"
    done
}

and then pipe both stdout and stderr to this function. Like python -u -m http.server 4000 2>&1 | output_alert

This will print the output of the program while alerting when there is activity.

@tanertas
Copy link
Author

Thank you for notice. It seems @kovidgoyal already implemented this feature in source code anyway.

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

4 participants