View Issue Details

IDProjectCategoryView StatusLast Update
0000259tcshgeneralpublic2013-06-25 22:17
ReporterOlivier Mengué 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformGNU/Linux i386OSUbuntuOS Version12.04
Product Version6.18.01 
Target VersionFixed in Version 
Summary0000259: alias containing if/then/else pollutes the history
DescriptionThe interactive history is polluted if the user runs an alias that is composed of an if/then/else structure.
It looks like the commands after the 'else' statement are injected in the history as if the user typed them.

This is especially annoying when you want to use an if/then/else in a 'precmd' alias as two commands are injected every time you run a command (or just press enter).
Steps To ReproduceRun those commands:
---------8<---------8<-----------8<-----------
> cat bug-history-alias.tcsh

alias precmd 'if ( 1 ) then \
    echo "Press the up key to check the history\!" \
else \
        : Bug 2 \
endif ; : Bug 1'

echo "Check this: history | tail -4"

> source bug-history-alias.tcsh
Check this: history | tail -4
Press the up key to check the history!
> history | tail -4
     2 22:56 source bug-history-alias.tcsh
     3 22:56 : Bug 2
     4 22:56 endif ; : Bug 1
     5 22:56 history | tail -4
Press the up key to check the history!
>
---------8<---------8<-----------8<-----------

As you can see entries 3 and 4 have been injected into the history while the user did not type them.
Worse, if we use the up key we see the entries in this order: 4, 3, 5, 2... So the history output is not even consistent with the edit history.
Additional InformationThis is a blocking bug for the tcsh port of my 'angel-PS1' project at
https://github.com/dolmen/angel-PS1
TagsNo tags attached.

Relationships

Activities

Olivier Mengué

Olivier Mengué

2013-06-25 22:17

reporter  

bug-history-alias.tcsh (272 bytes)

Issue History

Date Modified Username Field Change
2013-06-25 22:17 Olivier Mengué New Issue
2013-06-25 22:17 Olivier Mengué File Added: bug-history-alias.tcsh