In R, I do press the arrow keys, and 2 things happen : On one hand, the symbols ^[[A^[[A^[[A appear; On the other hand, shall I start typing a command, such as "library", I begin by typing the first 2 letters "li", click "left arrow", and the result is "li "(i.e. lots of spaces) instead of having the command "library" written on the screen. Is there any way to fix it please ? Thanks, Bogdan [[alternative HTML version deleted]]
Can you provide the output of sessionInfo()? And are you connected remotely? On February 24, 2022 4:14:49 PM PST, Bogdan Tanasa <tanasa at gmail.com> wrote:>In R, I do press the arrow keys, and 2 things happen : > >On one hand, the symbols ^[[A^[[A^[[A appear; > >On the other hand, shall I start typing a command, such as "library", I >begin by typing the first 2 letters "li", click "left arrow", and the >result is "li "(i.e. lots of spaces) instead of having the command >"library" written on the screen. > >Is there any way to fix it please ? Thanks, > >Bogdan > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- Sent from my phone. Please excuse my brevity.
On Thu, 24 Feb 2022 16:14:49 -0800 Bogdan Tanasa <tanasa at gmail.com> wrote:> On one hand, the symbols ^[[A^[[A^[[A appear;> On the other hand, shall I start typing a command, such as "library", > I begin by typing the first 2 letters "li", click "left arrow", and > the result is "li "(i.e. lots of spaces) instead of having the command > "library" written on the screen.Did you mean Tab here? I.e. you type "libr", you press Tab, and R autocompletes that to "library". Sounds like readline and/or terminal problems. How was R compiled and installed on this system? What terminal are you running R in, and is the $TERM variable set correctly? Does the target system have the correct termcap definitions for this terminal? Perhaps https://cran.r-project.org/doc/manuals/r-release/R-admin.html could be of some help to you. -- Best regards, Ivan
You do not say anything about the operating system you are using, about whether it was built with "readline" support or not, whether you are calling R directly or through a pseudo-tty or remotely through ssh or PuTty. (1) ^[[A is simply an echo of the ANSI escape sequence for the move-left terminal function. This is exactly what you would expect to see from a program that doesn't understand escape sequences. (2) You can tell whether R was built with "readline" support by entering> extSoftVersion()["readline"]"7.0" is the answer I get. (3) R-with-readline uses the "move left" terminal function to MOVE LEFT within the line you are entering (and the "move right" terminal function to move right, strange as it may seem). It does not use the left arrow for completion. That's the job of "tab". (4) If I type "li<COMPLETE>" R (readline) beeps at me because it does not know what character comes next. If I type "<COMPLETE>" again, it shows me a list of possibilities. There are 17 of them. If I type "lib<COMPLETE>" I get another beep, and typing "<COMPLETE>" again shows me a list of 4 possibilities. Typing "libr<COMPLETE>" gives me "library" and *another* beep because there are still 3 possibilities. (5) Once again, the <COMPLETE> key is Tab. On Sun, 27 Feb 2022 at 04:51, Bogdan Tanasa <tanasa at gmail.com> wrote:> In R, I do press the arrow keys, and 2 things happen : > > On one hand, the symbols ^[[A^[[A^[[A appear; > > On the other hand, shall I start typing a command, such as "library", I > begin by typing the first 2 letters "li", click "left arrow", and the > result is "li "(i.e. lots of spaces) instead of having the command > "library" written on the screen. > > Is there any way to fix it please ? Thanks, > > Bogdan > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]