Home Download Buy Blog Forum Support

SublimeREPL

Re: SublimeREPL

Postby vitaLee on Sat May 26, 2012 7:54 pm

EDIT
OK. a second later i noticed that both commands appear in context menu and i was just executing the onmodified one that comes with SublimeREPL.
now my question is how can i get rid of the default one and make sure it wont pop up the next time SublimeREPL updates?

what do i need to do to preserve configs between updates?
last time i brought the subject of syncing Ruby version with RVM current Ruby, and i needed to fix one line in config/Ruby/Main.sublime-menu.
now that change is overwritten.
what i tried was copying SublimeREPL command over to User/Default.sublime-commands specifying file path to User/SublimeREPL/config/Ruby/Main.sublime-menu
which contained the changes i'd like to preserve.
not sure which commands get loaded first and if one is not overwriting the other, thought. :roll:
what's the way to go?
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: SublimeREPL

Postby xeno.by on Tue Jun 05, 2012 12:46 am

I'm trying to make sublime repl into something that would replace the standard Windows shell for me. It was a piece of cake to add some custom completion: https://github.com/xeno-by/dotsublime/b ... letions.py, and I definitely have some more stuff in mind, so I'm really hopeful. But first things first.

The most significant problem is the overall sluggishness whenever any heavy output is involved. After several hundred lines of stdout, SublimeREPL starts lagging. Lags work as follows: ~100 lines get printed, then repl freezes for a second or two, then ~100 lines get printed again and so on. Any ideas what could be the reason?

Also, I noticed that at times repl "forgets" to print the last chunk of the program output, which then gets accumulated and messes us the next command I enter. Say, the chunk not printed was "foo", then my next command, say, "ls" will get "foo" prepended, which will post incorrect command to the interpreter. I can't definitively reproduce the problem, but it feels like it tends to happen when the application writes both to stdout and stderr. Anyone seen this behaviour?

P.S. I also submitted a pull request, which adds some conveniences to the improvised shell: https://github.com/wuub/SublimeREPL/pull/46. Would be lovely to discuss it.
xeno.by
 
Posts: 104
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: SublimeREPL

Postby wuub on Thu Jun 07, 2012 10:29 am

The most significant problem is the overall sluggishness ... Any ideas what could be the reason?


Greedy, 1 at a time byte reads forced on us by windows not supporting select() on file handles (SDTIO).
Offending methods that cause the lag:
https://github.com/wuub/SublimeREPL/blo ... pl.py#L122 + https://github.com/wuub/SublimeREPL/blo ... epl.py#L72 + https://github.com/wuub/SublimeREPL/blo ... pl.py#L107
Maybe adding a forced exit each +- 100chars in ReplReader would help, w/o the need to dive into ctypes + win32event in SubprocessRepl.read_bytes()?

I noticed that at times repl "forgets" to print the last chunk of the program output

Try to force the program you're running into unbuffered mode (for example -u for python). Delayed refresh are usually a sign of such buffering.

I also submitted a pull request, which adds some conveniences to the improvised shell: https://github.com/wuub/SublimeREPL/pull/46. Would be lovely to discuss it.

There are some superb additions there, preventing input from touching things before ._output_end was on the TODO for soooooooooooooooo long. Thank you for taking care of it :)
There are some small bugs that I want to find, for example your changes somehow reintroduced the problem with repl being unusable after manual clear (Ctrl+A, DEL). But it's not a huge problem. Thank you again :)

what do i need to do to preserve configs between updates?

In the next version you will be able to put updated/new configs in User/SublimeREPL/config. Stay tuned.

[general RVM problems]

I admit defeat and invite someone with better understanding of RVM internals to point me in the right direction. I understand what RVM does, but everything beyond that is a blur of bash aliases, env variables, symlinks and who knows what.
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: SublimeREPL

Postby francescob on Thu Jun 07, 2012 11:06 am

i'm just an rvm user and rails developer, but i'd gladly try and help
francescob
 
Posts: 20
Joined: Mon Apr 23, 2012 2:52 pm

Re: SublimeREPL

Postby wuub on Thu Jun 07, 2012 1:20 pm

SublimeREPL 1.0.40 was released just now.

- python text transfers are now handled using temporary files instead of simple copy+paste approach, this should fix problems with blank lines interrupting evaluation and repl producing lots of output during compilation (anyone willing to implements senders for other repls, please take a look at text_transfer.py and @sender decorator)
- REPL configs can be places in [packages]/User/SublimeREPL/config/... and those will be picked up first. You can add new repls or overwrite existing ones!!
- Changed the default syntax from R to R Console. (thanks tomschenkjr)
- SublimeText's console is now also exposed as a REPL (with history and stuff ;))
- Lots of improvements to backspace/enter/arrows/... handling wrt output end + crl+l clears REPL screen (thanks xeno-by)
- Bugfixes: kill on osx/linux (again),

EDIT:
hotfix: 1.0.41
- text transfer was broken for non python repls
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: SublimeREPL

Postby xeno.by on Mon Jun 11, 2012 11:34 pm

Hey Wojciech, I think you might be interested in https://github.com/sublimescala/sublime ... ss.py#L158.
xeno.by
 
Posts: 104
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: SublimeREPL

Postby Cobo on Thu Jun 14, 2012 12:50 pm

Hi!

First of all, thanks to wuub for this fantastic addition! Now, I am so dumb that I can't send selections of code or entire files to the REPL... so right now I'm copy/pasting it.

I've just started using SublimeText, on Windows, using Clojure. The REPL shows ok and works without a problem with the copypaste, it's just the combination of keys that sends a selection/function/file to the REPL. I've tried with what I've seen (F2 + ... ; F12 + ... ; and also some Alt/Shift/Control + other keys).

Anyone can guide this newbie? Thanks a lot!
Cobo
 
Posts: 1
Joined: Thu Jun 14, 2012 12:45 pm

Re: SublimeREPL

Postby wuub on Sat Aug 18, 2012 6:53 pm

A long overdue release (1.0.50) is now on github and should soon be available on package control.

Notable changes:
- filtering of ascii control codes
- fixed numerous bugs in keyboard handling (home, backspace, esc).
- python virtualenv support (automatically picks up venvs from ~/.venv and ~/.virtualenvs)
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: SublimeREPL

Postby wuub on Sun Aug 19, 2012 11:36 am

1.1.1 is out with remote Python over ssh and with virtualenv supprot (tested on Linux and OSX)

Documentation is still missing (as usual) but this short screencast should explain everything:
http://www.youtube.com/watch?v=zodAqBvKQm0

You really should have a passwordless/pubkey authentication setup for the host you want to connect to, or you will go mad.
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: SublimeREPL

Postby Shizka on Sun Sep 23, 2012 8:35 pm

Hello

I have been attempting to get Prolog up and running with this, but I haven't had any luck yet. Maybe you can help me out :)
The following is in /Packages/SublimeREPL/config/Prolog/Main.sublime-menu. I have edited the Default.sublime-commands aswell.
Code: Select all
[
     {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "r",
            "id": "SublimeREPL",
            "children":
            [
                {"command": "repl_open",
                 "caption": "Prolog",
                 "id": "repl_prolog",
                 "mnemonic": "p",
                 "args": {
                    "type": "subprocess",
                    "encoding": "utf8",
                    "external_id": "prolog",
                    "cmd": {"linux": ["swipl","--terminal=none"]},
                    "soft_quit": "\nhalt.\n",
                    "cwd": "$file_path",
                    "cmd_postfix": "\n",
                    "extend_env": {"linux": {"PATH": "{PATH}:/usr/lib/"}},
                    "suppress_echo": false,
                    "syntax": "/home/peter/.config/sublime-text-2/Packages/Prolog/Prolog.tmLanguage"
                    }
                }
            ]   
        }]
    }
]


When I open the REPL I can see that it is starting correctly. But nothing happens when I enter a command. From what I have read it could be because it isn't interactive. However using the -i flag haven't resolved the problem. Any ideas for what might be wrong?
Shizka
 
Posts: 4
Joined: Sun Sep 23, 2012 8:30 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 7 guests