Skip to content

SendCode cannot send codes to RStudio when upgrading RStudio to version 2022.12.0 #170

Open

Description

@LiangCZhang

HI,
I am using sublime text 4126 on Windows 10. Sendcode was working fine and can send R codes to RStudio via ctrl+enter. However, when RStudio is upgraded to version 2022.12.0 Build 353, SendCode is not working anymore. Could you have a look at this? Thanks.

Activity

  1. rrodrigueznt commented on Dec 20, 2022

    @rrodrigueznt

    I can confirm this behaviour on Windows 11.

  2. randy3k commented on Dec 20, 2022

    @randy3k
    Owner

    This is the python script that controls Rstudio
    https://github.com/randy3k/SendCode/blob/master/code_sender/winauto.py

    If someone wants to help, please follow the below steps and report what you see.

    rid =  find_rstudio()
    paste_to_rstudio(rid, from_view=False)  # this command should paste the current clipboard to Rstudio.
    
  3. rrodrigueznt commented on Dec 20, 2022

    @rrodrigueznt

    Hi! On macOS 13.0.1 (22A400) now. RStudio 2022.12.0 Build 353. When in an R script, the first cmd+Enter launches RStudio, but no line will be sent afterwards.

    It is the first time I have set up SendCode on Ventura. Thus I don't know if it is the new RStudio to blame or if I'm missing some step. Anyone can send an R code to Sublime working with macOS Venture?

    I will try on my Windows 11 boxes early tomorrow (my time). I will also try on Ubuntu 20.04.

  4. rrodrigueznt commented on Dec 21, 2022

    @rrodrigueznt

    From a Microsoft Windows 11 Pro Version 10.0.22621 Build 22621 running on a Dell XPS laptop:

    PS C:\Users\ricar\OneDrive\Documents\Downloads> python
    Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> exec(open('./winauto.py').read())
    >>> rid =  find_rstudio()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<string>", line 168, in find_rstudio
    Exception: window not found.
    >>>
    
  5. rrodrigueznt commented on Dec 21, 2022

    @rrodrigueznt

    Same result on a Windows 11 Pro 10.0.22621 Build 22621, same than above, running on a Dell OptiPlex 5080:

    PS C:\Users\ricar\OneDrive\Documents\Downloads> python
    Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> exec(open('./winauto.py').read())
    >>> rid =  find_rstudio()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<string>", line 168, in find_rstudio
    Exception: window not found.
    >>>
    
  6. gc5011 commented on Jan 3, 2023

    @gc5011

    I'm also having issues on OS X (I'm still on 10.15.7) with Rstudio (2022.12.0+353) when trying to use SendCode. This is the error message in the SublimeText console:

    subprocess.CalledProcessError: Command '['osascript', '/Users/username/Library/Application Support/Sublime Text 3/Packages/SendCode/code_sender/rstudio/rstudio.applescript', 'library(tidyverse)\nlibrary(lubridate)\nlibrary(arsenal)\nlibrary(zscorer)']' returned non-zero exit status 1

    In ScriptEditor, running tell application "RStudio" to cmd "print('hello')" returns an error: A """ can't go after this identifier". Is it possible that RStudio 2022.12.0+353 doesn't support applescript (or at least the syntax used in the sendcode rstudio.applescript)?

  7. gc5011 commented on Jan 4, 2023

    @gc5011

    @rrodrigueznt on OS X rolling back to RStudio 2022.72+576 solved the issue for me and I can send code to RStudio from sublime text. I've raised an issue in the Rstudio repo

  8. randy3k commented on Jan 4, 2023

    @randy3k
    Owner

    RStudio has moved to electron rstudio/rstudio/wiki/Electron-Desktop.

    On Mac, we use apple script to send code to RStudio and unfortunately electron doesn't support apple script.
    On Windows, we use native Win32 api, I beleive we just need to figure out the new window class name.

  9. gc5011 commented on Jan 4, 2023

    @gc5011
  10. phineas-pta commented on Jan 16, 2023

    @phineas-pta

    how do you search for windows class name? i tried winlister, got "Chrome_WidgetWin_1", modified SUBLIME_PATH\Data\Packages\SendCode\code_sender\winauto.py but it doesn't work

  11. emilBeBri commented on Feb 15, 2023

    @emilBeBri

    damn. A huge part of my workflow has just been destroyed. Guess it's time to move to neovim completely.

  12. fabeit commented on Feb 27, 2023

    @fabeit

    Reporting the same issue. I don't like the Rstudio editor, I hope someone will help fix this. Any alternative to Sendcode?

  13. Sijianf commented on Oct 2, 2023

    @Sijianf

    In the future, will there be updates for SendCode to make it support the latest RStudio? Thanks!
    I am using a Macbook, and I have rolled back to the older version of RStudio. However, the plot function was disabled since R has updated its graphic engine. SendCode would stop sending codes once I called a plot() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions