[Rd] Bug in TAB handling for Win32 Rterm and Rgui (PR#9820)

whorfin at pixar.com whorfin at pixar.com
Wed Aug 1 20:12:34 CEST 2007

Full_Name: Rick Sayre
Version: 2.5.1
OS: Windows XP Pro
Submission from: (NULL) (

I floated this to r-help a few days ago just to see if i was off-base.
Here we go:

Before I start, i want to first extend thanks for the big improvements
in integration of command completion for the windows version.  Really
nice to have now.  But i believe there are some issues.

In getline/getline.c, the "tab" case of the character handling switch
statement in getline() simply "break;"s to the end if tab completion is not 
enabled, thus eating the tab.  Thus, if tab completion is disabled, a tab no
longer serves as a tab; it disappears.

likewise, in console.c, if k == TABKEY, a return is done without adding 
the key to kbuf, thus TAB is always discarded, even if completion is 

It seems to me that this is wrong.

This new TAB behavior now makes it impossible for me to copy/paste text
from a text file of R expressions which use TABs.  Copy paste behavior
which worked in 2.4.x for Rterm now does not, since the discarded TABs
mean that keyword separators may disappear, changing the meaning of
pasted text.  Rgui thankfully still works with copy/paste, since the
processing code is bypassed when activating the "paste" command.  But pressing
the TAB key in Rgui with completion disabled results in the tab being eaten,
so in this sense behavior has changed in an undesireable way from previous

I'd like to request the ability to have both --- TAB as a working
separator, and the ability to configure the completion key to something
other than TAB.  This way one can both enjoy completion and successfully
copy/paste text containing tabs.



More information about the R-devel mailing list