Re: [R-SIG-Mac] ANSI escape weirdness on M1 (libedit issue?)

2021-11-03 Thread Simon Urbanek


Gabor,

as you can see the x86_64 readline is a very old build 5.2-14 - it is the last 
version released under GPL-2. Later versions are to my best knowledge 
license-incompatible since they are released under GPL-3 only and thus do not 
allow the use in GPL-2 software. The arm64 version currently relies on the 
system library which is libedit. If it is of interest I can check if readline 
5.2 can be built for arm64, but it predates the architecture by quite a few 
years ;).

Cheers,
Simon


> On Nov 4, 2021, at 7:12 AM, Gábor Csárdi  wrote:
> 
> On Wed, Nov 3, 2021 at 7:00 PM Prof Brian Ripley  
> wrote:
> [...]
>> AFAIK the reason for not distributing readline with binary distributions
>> of R is perceived licence restrictions.
> 
> So is the license different for x86_64? Because those builds come with 
> readline:
> ❯ R-4.1 -q -e 'extSoftVersion()[["readline"]]'
>> extSoftVersion()[["readline"]]
> [1] "5.2"
> 
> Whereas the arm64 build has:
> ❯ R-4.1-arm64 -q -e 'extSoftVersion()[["readline"]]'
>> extSoftVersion()[["readline"]]
> [1] "4.2 (EditLine wrapper)"
> 
> Gabor
> 
> ___
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] ANSI escape weirdness on M1 (libedit issue?)

2021-11-03 Thread Gábor Csárdi
On Wed, Nov 3, 2021 at 7:00 PM Prof Brian Ripley  wrote:
[...]
> AFAIK the reason for not distributing readline with binary distributions
> of R is perceived licence restrictions.

So is the license different for x86_64? Because those builds come with readline:
❯ R-4.1 -q -e 'extSoftVersion()[["readline"]]'
> extSoftVersion()[["readline"]]
[1] "5.2"

Whereas the arm64 build has:
❯ R-4.1-arm64 -q -e 'extSoftVersion()[["readline"]]'
> extSoftVersion()[["readline"]]
[1] "4.2 (EditLine wrapper)"

Gabor

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] ANSI escape weirdness on M1 (libedit issue?)

2021-11-03 Thread Prof Brian Ripley

On 03/11/2021 12:21, Gábor Csárdi wrote:

Anyone else noticed some weirdness with the arm build when the prompt
has ANSI escape codes?

E.g. in a terminal run this
options(prompt = "\033[1m> \033[0m")

and then at the new prompt type in some longer word and press CTRL+A.


Longer than what?


The cursor does not go back to the beginning of the line, probably
because the width of the prompt is not calculated correctly by the
underlying system library.

readline is not listed at https://mac.r-project.org/libs-arm64/ while
it is listed among the intel libs. Does that mean that R uses libedit
on arm64? Is this an issue with libedit?


This is why we added extSoftversion(): please use it.

For my personal build of R-patched (which uses readline 8.1) this works 
as I expected.  With the CRAN build of 4.1.2 I do see some weirdness, e.g.


> options(prompt = "\033[1mR> \033[0m")
R> abcdef

where after the Ctrl-A the cursor moves forwards a couple of characters. 
 (That 'R>' is bold will not show up in an email.


All on Monterey 12.0.1.

AFAIK the reason for not distributing readline with binary distributions 
of R is perceived licence restrictions.


--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


[R-SIG-Mac] ANSI escape weirdness on M1 (libedit issue?)

2021-11-03 Thread Gábor Csárdi
Anyone else noticed some weirdness with the arm build when the prompt
has ANSI escape codes?

E.g. in a terminal run this
options(prompt = "\033[1m> \033[0m")

and then at the new prompt type in some longer word and press CTRL+A.
The cursor does not go back to the beginning of the line, probably
because the width of the prompt is not calculated correctly by the
underlying system library.

readline is not listed at https://mac.r-project.org/libs-arm64/ while
it is listed among the intel libs. Does that mean that R uses libedit
on arm64? Is this an issue with libedit?

Thanks,
Gabor

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac