<div dir="ltr">This problem has continued to haunt me through more recent version of macos and R. My understanding from doing research is that this is something that Apple broke, but the problem is very disruptive when trying to debug longer scripts. Have you found any work-arounds other than the clear console solution?<br><br>I'd also be willing to contribute to a fix for this problem if there is a viable way forward.<br><br>On Saturday, June 17, 2017 at 6:36:46 AM UTC-4, Martin Batholdy via R-SIG-Mac wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Dear all,<p>sorry for the late response.</p><p>Here some more observations:<br>It seems to really depend on the output length. As soon as I “clear console” it is very fast again and slows down significantly the more lines of code are printed.</p><p>The strange error-message ("IMKInputSession presentFunctionRowItemTextInpu<wbr>tViewWithEndpoint:<wbr>completionHandler …”) is not unique to the RGui, but also appears in terminal occasionally (not sure yet by what it is triggered exactly).</p><p><br>I have installed:<br>XQuartz 2.7.11<br>XCode 8.1 (8B62) </p><p><br>And here is the output of sessionInfo():</p><p>R version 3.4.0 (2017-04-21)<br>Platform: x86_64-apple-darwin15.6.0 (64-bit)<br>Running under: macOS Sierra 10.12.5</p><p>Matrix products: default<br>BLAS: /Library/Frameworks/R.<wbr>framework/Versions/3.4/<wbr>Resources/lib/libRblas.0.dylib<br>LAPACK: /Library/Frameworks/R.<wbr>framework/Versions/3.4/<wbr>Resources/lib/libRlapack.dylib</p><p>locale:<br>[1] en_US.UTF-8/en_US.UTF-8/en_US.<wbr>UTF-8/C/en_US.UTF-8/en_US.UTF-<wbr>8</p><p>attached base packages:<br>[1] grid      graphics  grDevices utils     datasets  stats     methods  <br>[8] base     </p><p>other attached packages:<br> [1] markovchain_0.6.9.3 shape_1.4.2         fields_9.0         <br> [4] maps_3.2.0          spam_1.4-0          plotrix_3.6-5      <br> [7] plyr_1.8.4          GGally_1.3.1        Hmisc_4.0-3        <br>[10] ggplot2_2.2.1       Formula_1.2-1       survival_2.41-3    <br>[13] lattice_0.20-35    </p><p>loaded via a namespace (and not attached):<br> [1] Rcpp_0.12.11        compiler_3.4.0      RColorBrewer_1.1-2 <br> [4] base64enc_0.1-3     tools_3.4.0         rpart_4.1-11       <br> [7] digest_0.6.12       tibble_1.3.1        gtable_0.2.0       <br>[10] checkmate_1.8.2     htmlTable_1.9       rlang_0.1.1        <br>[13] igraph_1.0.1        Matrix_1.2-9        parallel_3.4.0     <br>[16] expm_0.999-2        gridExtra_2.2.1     stringr_1.2.0      <br>[19] cluster_2.0.6       knitr_1.16          htmlwidgets_0.8    <br>[22] stats4_3.4.0        nnet_7.3-12         reshape_0.8.6      <br>[25] data.table_1.10.4   foreign_0.8-67      latticeExtra_0.6-28<br>[28] matlab_1.0.2        magrittr_1.5        backports_1.1.0    <br>[31] scales_0.4.1        htmltools_0.3.6     splines_3.4.0      <br>[34] colorspace_1.3-2    stringi_1.1.5       acepack_1.4.1      <br>[37] RcppParallel_4.3.20 lazyeval_0.2.0      munsell_0.4.3  </p><p></p><p>Hope that helps!</p><p></p><p>> On 29. May 2017, at 22:44 , David Winsemius <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="k_WjEVHVAQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">dwins...@comcast.net</a>> wrote:<br>> <br>> <br>>> On May 27, 2017, at 3:44 AM, Martin Batholdy via R-SIG-Mac <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="k_WjEVHVAQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">r-si...@r-project.org</a>> wrote:<br>>> <br>>> Dear all,<br>>> <br>>> I just switched to a new 2016 Macbook Pro and noticed that R is very slow when used over the R app. Using R via the terminal is significantly faster.<br>>> Especially, drawing figures in quartz is really slow<br>> <br>> Not sure what "drawing a figure" actually means. Can you present code?<br>> <br>>> and sometimes the following error message is printed – but this might be unrelated to the speed issue:<br>>> <br>>> IMKInputSession presentFunctionRowItemTextInpu<wbr>tViewWithEndpoint:<wbr>completionHandler: : [self textInputContext]=0x0 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=<wbr>The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.<wbr>EmojiFunctionRowItem<br>> <br>> This error in Sierra hosted apps has also been reported on other app forums (as well as once before on this mailing list Mon, 19 Dec 2016 by <a href="javascript:" target="_blank" gdf-obfuscated-mailto="k_WjEVHVAQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">a.bec...@sheffield.ac.uk</a> but got no response):<br>> <br>> <a href="https://discuss.atom.io/t/imkinputsession-error/36273" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fdiscuss.atom.io%2Ft%2Fimkinputsession-error%2F36273\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGBeKh-QWbfyq7Uhx0JN8N_q1TyXA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fdiscuss.atom.io%2Ft%2Fimkinputsession-error%2F36273\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGBeKh-QWbfyq7Uhx0JN8N_q1TyXA';return true;">https://discuss.atom.io/t/<wbr>imkinputsession-error/36273</a><br>> <br>> <a href="https://github.com/macvim-dev/macvim/issues/422" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmacvim-dev%2Fmacvim%2Fissues%2F422\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH_LFSnWIwx1VuJaTX4asyHW2ZJUg';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmacvim-dev%2Fmacvim%2Fissues%2F422\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH_LFSnWIwx1VuJaTX4asyHW2ZJUg';return true;">https://github.com/macvim-dev/<wbr>macvim/issues/422</a><br>> <br>> <a href="https://stackoverflow.com/questions/41249603/tkinter-error-in-terminal-possibly-from-my-key-bind" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F41249603%2Ftkinter-error-in-terminal-possibly-from-my-key-bind\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEbSRuyVRa-Nlfe7G-oppP7Fyq5ng';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F41249603%2Ftkinter-error-in-terminal-possibly-from-my-key-bind\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEbSRuyVRa-Nlfe7G-oppP7Fyq5ng';return true;">https://stackoverflow.com/<wbr>questions/41249603/tkinter-<wbr>error-in-terminal-possibly-<wbr>from-my-key-bind</a><br>> <br>> <br>>> <br>>> Is this a known issue related to Sierra and/or the new Macbook Pros? Are there any workarounds or fixes?<br>> <br>> I surely don't know about workarounds but this does appear to be specific to Sierra. My MacbookPro is too old to get an update to Sierra. I do wonder if you have an updated (or any) XQuartz and XCode? Generally a complete question will include your versions of all essential system and R packages. <br>> <br>> What does sessionInfo() return?<br>> <br>> Try clicking on the system taskbar XQuartz icon and  using `XQuartz/About X11` and copying the version. I get:<br>> <br>> XQuartz 2.7.11 (xorg-server 1.18.4)<br>> <br>> My XCode version is: Version 8.2.1 (8C1002) but ISTR that Sierra needs a later version.<br>> <br>> And you should also probably indicate whether you have used either MacPorts or homebrew.<br>> <br>> The other system resource needed in the past was Tcl/Tk although I think that now should get installed and attached by default with any current version of R. The last link of the three above appeared related to the Tk interface which is used by R.app and the tcltk package is part of the base installation, so might be relevant, but this is written at the level of speculation. My other hypothesis is that two different installations of Tcl/Tk might give problems on one machine that were not encountered by others.<br>> <br>> -- <br>> David.<br>> <br>>> <br>>> <br>>> Thanks for any suggestions!<br>>> <br>>> ______________________________<wbr>_________________<br>>> R-SIG-Mac mailing list<br>>> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="k_WjEVHVAQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">R-SI...@r-project.org</a><br>>> <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-mac" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;">https://stat.ethz.ch/mailman/<wbr>listinfo/r-sig-mac</a><br>> <br>> David Winsemius<br>> Alameda, CA, USA<br>> </p><p>______________________________<wbr>_________________<br>R-SIG-Mac mailing list<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="k_WjEVHVAQAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">R-SI...@r-project.org</a><br><a href="https://stat.ethz.ch/mailman/listinfo/r-sig-mac" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;">https://stat.ethz.ch/mailman/<wbr>listinfo/r-sig-mac</a></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></blockquote></div>