tcsh history file fails to save commands with "!" properly

Bug #139537 reported by Sunjae Park
4
Affects Status Importance Assigned to Milestone
tcsh (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: tcsh

tcsh fails to save commands with "!" in the .history file properly. Since "!" is a special character for tcsh, it needs to be escaped by a backslash character. Auto-expansion automagically adds the backslash. However, this is not the case for the .history file.

Steps to reproduce:
1> Enter a command with "!" in it.
$ ls this_blows_up\!
2> Save the entered command by either exiting tcsh or entering "history -S"
3> Check the contents of .history. The command is now saved without the backslash. Example:
...
#+1189745605
ls this_blows_up!
#+1189745608
history -S

Since I use the history function of tcsh fairly extensively (biggest reason for tcsh over bash), this is somewhat annoying.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 RC or later?

Changed in tcsh:
status: New → Incomplete
Revision history for this message
Sunjae Park (darehanl) wrote :

Tcsh seems to handle the "!" mark in file names more gracefully now, but no, it's still not saved properly in the history file.

$ echo bye\!\! > file
$ history -S
$ tail ~/.history
...
#+1224787164
echo bye!! > file
#+1224787166
history -S
         The file .history is saved incorrectly.

$ tcsh
$ history
...
   499 13:39 echo bye!! > file
   500 13:39 history -S
   501 13:41 history
          We can now see that the history has been loaded incorrectly.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

confirmed in latest Karmic

Changed in tcsh (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Lucas Nussbaum (lucas) wrote :

will be fixed in the next Debian upload.

Revision history for this message
Lucas Nussbaum (lucas) wrote :

fixed in debian git tree

Changed in tcsh (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tcsh - 6.17.02-3

---------------
tcsh (6.17.02-3) unstable; urgency=low

  * Re-add 12_unknown_lscolors.patch. Closes segfault when removed.
    Closes: #592089.

tcsh (6.17.02-2) unstable; urgency=low

  * Set $COLUMNS and $LINES in csh.{cshrc,login}. Closes: #580498. LP: #546032
  * Standards-Version bumped to 3.8.4. No changes needed.
  * Upload to unstable.

tcsh (6.17.02-1) experimental; urgency=low

  * New upstream release.
  * Merged patches:
    + 01_build.1.patch
    + 06_man.patch
    + 10_hurd.patch
  * Removed patches:
    + 02_fix.patch - no longer needed
    + 12_unknown_lscolors.patch - upstream says:
        "rejected - will not apply now, I'd rather see the error and
         fix $LS_COLORS than eat it up silently."
  * Bug fixes:
    + "Crash with autoexpand and no histchars" (LP: #96490)
    + "tcsh history file fails to save commands with "!" properly" (LP: #139537)
    + "tcsh's sending of HUPs to children is broken" (Closes: #314641)
    + "tcsh doesn't support CR/LF end-of-lines in some cases, contrary to csh"
      (Closes: #462346)
    + "complete.tcsh bug in postmap" (Closes: #552632)
  * Fix catalogs generation to use the charset
  * Add disable-lexical.at-31.patch:
    disable broken comments test
  * Upload to experimental as it is a pre-release.
 -- Ubuntu Archive Auto-Sync <email address hidden> Fri, 15 Oct 2010 10:02:07 +0000

Changed in tcsh (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.