Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16032

Q: Is there a way to tell why DEBUG trap was triggered?

From Šimon Let <simon.a.let@gmail.com>
Newsgroups gnu.bash.bug
Subject Q: Is there a way to tell why DEBUG trap was triggered?
Date 2020-03-15 12:41 +0100
Message-ID <mailman.2744.1584272511.2412.bug-bash@gnu.org> (permalink)
References <CAOdNpm_9gFMXFJigxYgSVHgWwKdA0XE-TvbabXSs85d=R6WREQ@mail.gmail.com>

Show all headers | View raw


Hi All,

I'm using PROMPT_COMMAND and DEBUG trap to emulate "PRE" and "POST" hooks
in bash. I have run into the issue where the DEBUG trap gets triggered when
any custom readline widget/function is executed. I would like to
programmatically determine if the DEBUG trap was triggered for a "real"
interactive command or if it was triggered for a custom readline widget.

I tried to use READLINE_LINE and READLINE_POINT variables but these are not
set during the DEBUG trap.

Is there another way that can be used to determine why the DEBUG trap was
triggered?

PS: I'm wondering what is your opinion on providing PRE and POST functions
natively in bash?


Thank you,

Šimon Let

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Q: Is there a way to tell why DEBUG trap was triggered? Šimon Let <simon.a.let@gmail.com> - 2020-03-15 12:41 +0100

csiph-web