[Top][All Lists]

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

Re: fc echoing DEBUG trap

From: Carlos Pita
Subject: Re: fc echoing DEBUG trap
Date: Tue, 24 Sep 2013 12:48:03 -0300

I see that, Chet. But it's not necessarily supposed to be echoed,
that's what I'm saying. It's counterintuitive that fc prints the
output. In fact, the output could very confusing. I have a complicated
expression in the DEBUG trap that doesn't produce any output by
itself, but this is what I see after calling fc, typing ls and leaving
the editor:

address@hidden ~]$ fc
[[ $BASH_COMMAND == "termic_hook @prompt" ]] || termic_hook "$BASH_COMMAND"
get_profile $*)
get_profile $*
basename $1)
basename $1
Anki  apps  bin  blog  blog2  books  down  movies  music  node_modules
 notes  post.html  post.rst  store  tmp  work

"ls" is ok, the last line is expected, but my debug trap doesn't
output what it's being listed in between, it's more like if I had "set
-x". It's not even that the trap is being called recursively.

Someone else got into this issue before:


Of course, it's possible to alias fc to reset the trap before calling
the editor and restore after exiting, but it's a hack.

On Tue, Sep 24, 2013 at 11:18 AM, Chet Ramey <address@hidden> wrote:
> On 9/19/13 2:12 PM, Carlos Pita wrote:
>> Bash Version: 4.2
>> Patch Level: 45
>> Release Status: release
>> Description:
>>   If you set a DEBUG trap fc echoes it along the edited commands after
>> leaving editor.
> Sure: the DEBUG trap is supposed to be executed before every simple
> command (and a few other types).
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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