Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?UTF-8?Q?=C5=A0imon_Let?= Newsgroups: gnu.bash.bug Subject: Q: Is there a way to tell why DEBUG trap was triggered? Date: Sun, 15 Mar 2020 12:41:36 +0100 Lines: 21 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1584272512 20524 209.51.188.17 (15 Mar 2020 11:41:52 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6/FTErpu5L0j90WEYQKre01Of3VpWm0XdPImC6bRmPI=; b=UqeRgwuoMN/iPv1HBta2mM49WWeKm6d/qt2DOLacUrUeBBn/LYlGea0gfloT8xnoRV 390vjP35fW5TPUL/l8NAPxPvFQZ4s+1KS2/kWtxw2fm4kKLlkTH30dezrxGTo3+12jp5 1M1XP1Fb/x2+vD9/Qx9VgMtH0dnMwQCrhwGNzWfX9HmwVvCOntYpOkrJneX5bhfHIZU7 IXTVhrGd+tuFLMWEefnl9s2702W1m4Jp5D9UvXVSBheM6NB8C8HZnzUu1RxtN5wkRkXL yLHexzPvkq5NXPmSD4mdu4QE/IV6BGv4WWNhD2S56N9glbIHEVQUS/5heDc/SxBelGiM bjxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6/FTErpu5L0j90WEYQKre01Of3VpWm0XdPImC6bRmPI=; b=AxQey+POrzgnDdIPYlcbxl2jr/t6aQADLb1LmBGtiVxE7plsD/QeIy1In5gk2+K3// Y1kFdzSu35of5RS71ly73akHGRZi+NAc1CjNXCpkczz7Ei28hEuWoxHT/hZ6ukayUlyN U61Yzlcu8VmtdnS7eu5TG3AAwbt6BWhGuVRtaIW02EcWjL2Ao7kM01JzGq7UsplYBhem c11Q/2wXZIu5F37rY68wlHffl3xaDKgQ2SPp8MoT3wey/ftBCa+6fnZaMvbSMi0Q71XE BtYXW+ZpLqFa9ELKFWjBRAO0/DQWjSbkhrD01yvUf5mtoUVOOvYdiFT9y/GmKA+sXV5i fJzQ== X-Gm-Message-State: ANhLgQ3OsO/BKa2Kr+xc/El+DxYP2mOqYpeK/5Zu3yks/66hOd8IajoF UYxWl+nE4ikYU++VRVvuDJ7jd4XxzNBPL6gSkakDWw== X-Google-Smtp-Source: ADFU+vueekVEzSEZht3nB5pL9YsCEK0ENNYo59WLiBVKZDGE8/WJ5mCecTxkcyV5ATTUyZENX3wHWCmWMS1k+1dEoM4= X-Received: by 2002:a02:3b09:: with SMTP id c9mr20924553jaa.122.1584272507806; Sun, 15 Mar 2020 04:41:47 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d2a X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com gnu.bash.bug:16032 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, =C5=A0imon Let