bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding the last foreground command in the current session


From: Debarshi Ray
Subject: Finding the last foreground command in the current session
Date: Thu, 5 Feb 2015 11:54:43 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hey,

I work on gnome-terminal. I am trying to add support for notifying the
user when a long-running command finishes in an inactive tab or
window.  I am currently emitting a custom escape sequence [1] from
PROMPT_COMMAND, with the command parsed from $(history 1) as an
argument.

However, we are seeing some problems.

If you are using job control, then the last command in the history is
not the actual command that you were running.

The other is that we get a spurious emission on shell start-up.
Usually it is a not a problem because it is the active tab, so we
filter it out anyway. However if you spawn a few tabs very fast, then
it can happen that the tab was already inactive by the time the prompt
showed up.  We work around this in the terminal.

I don't want to make gnome-terminal use trap ... DEBUG to record the
commands either because that would be hijacking something that the
user would want to use.

What do you think? Any suggestions?

Cheers, Debarshi

[1] OSC 777 which urxvt and terminology also use for plugins and
    extensions

Attachment: pgp086QbQHUZm.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]