From xie at yihui.name  Wed Nov  6 00:32:35 2013
From: xie at yihui.name (Yihui Xie)
Date: Tue, 5 Nov 2013 17:32:35 -0600
Subject: [Rd] cat with backspace and newline characters
In-Reply-To: <A750360B-31A8-49EB-B21F-87EE4BA6E412@gmail.com>
References: <CAHavPHGe1A7R6RxD45exQnq7zJXWatiKQ8rR7SiFJBE2RGVQDQ@mail.gmail.com>
	<CADv2QyG6Nvn+YJ46Pz5PF7FqB9Q-LnEeLE4_EAgfVgBKo+EakA@mail.gmail.com>
	<CAHavPHH7VMYxBLjJsDO_2wwS-tC=gwbHiMfXVeP4fhXPZiJwNg@mail.gmail.com>
	<CAH7sKSN6a7ObU8g7xXf+fHq0cdMeKvsr7PSsorhNZ=DP3Pf8Ow@mail.gmail.com>
	<21112.61708.698124.149056@stat.math.ethz.ch>
	<8E2469B4-2A7B-44DD-896F-F409C39F4496@sciviews.org>
	<21113.8847.603856.486049@stat.math.ethz.ch>
	<A750360B-31A8-49EB-B21F-87EE4BA6E412@gmail.com>
Message-ID: <CANROs4e=Do0ejPc7w=rOzG8zzNdhkmYWFJN=qU61JQRGnLWiPQ@mail.gmail.com>

Yes, that indeed sounds like a problem, but example(txtProgressBar),
which is based on \r, works well in the RStudio console. Anyway,
thanks for all the experiments, and (to Renaud) support.rstudio.org is
the place to report such problems.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, Nov 5, 2013 at 4:57 PM, peter dalgaard <pdalgd at gmail.com> wrote:
>
>
> So in a sense, it is the prompt that is tweaked to ?jump to beginning of next line, unless already at beginning of line?. I don?t recall any ?real? terminal having an escape sequence for that, but I wouldn?t put it past ESS to do something similar.
>
> I see your point about cat(?pi?, pi), but I would expect that the bad habit would get cured first time it was attempted to print something between it and the next prompt. I?m actually more worried/puzzled that ?\r? behaves strangely (in Rstudio, not R.app):
>
>> cat("123");cat("\r456")
> 456
>> cat("123\r");cat("456")
> 123456
>
> People do sometimes use this pattern for displaying progress (e.g. iteration counts).
>



[Rd] cat with backspace and newline characters
Yihui Xie