check command-line text ?

9 views
Skip to first unread message

M Kelly

unread,
Aug 15, 2019, 11:46:32 AM8/15/19
to tmux-users
Hi,

Anyone know if its possible to know within tmux if there is any text currently present on the command-line ?
(ie something other than spaces after the shell prompt)  In eiither root or copy-mode.

thx for everything tmux,
-mark

Nicholas Marriott

unread,
Aug 15, 2019, 11:50:46 AM8/15/19
to M Kelly, tmux-users
You could probably script it with capture-pane and grep and maybe the cursor_y format.

--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/CAD5ox-E0uGJxTKWTaycF%3DvQgDM_RYvG7AErLhfcnNVZ_HusJKg%40mail.gmail.com.

M Kelly

unread,
Aug 16, 2019, 12:12:12 AM8/16/19
to Nicholas Marriott, tmux-users
Hi,

Thanks.  I managed this to determine if something was typed -

has_text=$(tmux capture-pane -p | tac | sed '/^$/d' | head -n 1 | awk '{print NF-1}')

(probably don't need the sed to remove esc seq)

take care,
-mark

Reply all
Reply to author
Forward
0 new messages