From renaud at mancala.cbio.uct.ac.za  Thu Nov  7 08:35:31 2013
From: renaud at mancala.cbio.uct.ac.za (Renaud Gaujoux)
Date: Thu, 7 Nov 2013 09:35:31 +0200
Subject: [Rd] cat with backspace and newline characters
In-Reply-To: <15FAF9D3-1BA6-48EA-8B98-1347B97256CD@r-project.org>
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>
	<CANROs4e=Do0ejPc7w=rOzG8zzNdhkmYWFJN=qU61JQRGnLWiPQ@mail.gmail.com>
	<CAHavPHHwsSq05zhDcCVMBo6kbvgBRwetCx45H19knmRU1xs-_Q@mail.gmail.com>
	<15FAF9D3-1BA6-48EA-8B98-1347B97256CD@r-project.org>
Message-ID: <CAHavPHEOdVJQH_iv3WhxZm65uoJPh+Wn1=B1Vd+O7Fdt3aQnTw@mail.gmail.com>

I agree that the handling of \b is not that strange, once one agrees
on what \b actually means, i.e. "go back one character" and not
"delete previous character".
The fact that R GUI on Mac and Windows interprets/renders it
differently shows that normality and strangeness is quite relative
though.

To make my previous response clearer, I was just wondering if the
printing of R prompt character ">" after the evaluation of an
expression could detect trailing \b from cat in stdout/stderr and
shift its position so that it is displayed after the last printed
character. For example cat("abc\b\b\b") would give

abc>
and not
a> c

But this is:
0) Again platform, front-end dependent;
1) maybe not be possible (e.g., can we actually move forward without
printing a character that would erase the previous output?)
2) maybe not even desirable;
3) certainly not worth the effort anyway!

I guess we can happily close this thread :D
Many thanks.

Bests,
Renaud



[Rd] cat with backspace and newline characters
Renaud Gaujoux