Coder Social home page Coder Social logo

wuub / sublimerepl Goto Github PK

View Code? Open in Web Editor NEW
2.1K 2.1K 313.0 922 KB

SublimeREPL - run an interpreter inside ST2 (Clojure, CoffeeScript, F#, Groovy, Haskell, Lua, MozRepl, NodeJS, Python, R, Ruby, Scala, shell or configure one yourself)

Home Page: https://github.com/wuub/SublimeREPL

License: Other

JavaScript 36.81% Python 59.62% Io 2.12% Perl 0.10% Ruby 1.35%

sublimerepl's Introduction

SublimeREPL for SublimeText (2 and 3)

Stories in Ready

If you would like to donate to support SublimeREPL development, you can do so using GitTip or PayPal. Someone willing to take care of documentation would also be very welcome :-)

Features

Common

  • Run an interpreter (REPL) inside SublimeText2 view/tab.
  • Per-language persistent REPL history.
  • Easily evaluate code in the running REPL
  • Replace your current build system, and use stdin in your programs.
  • Rich configuration with platform specific settings, project/file dependent environment variables and sane defaults.

Python

  • Launch python in local or remote(1) virtualenv.
  • Quickly run selected script or launch PDB.
  • Use SublimeText2 Python console with history and multiline input.

(1) - (ssh, linux/osx only)

Screenshots

Running python code in SublimeREPL

Running python code in SublimeREPL

R on Windows

R on Windows

Videos

Installation

  1. Install Package Control. http://wbond.net/sublime_packages/package_control
  2. Install SublimeREPL
  3. Preferences | Package Control | Package Control: Install Package
  4. Choose SublimeREPL
  5. Restart SublimeText2
  6. Configure SublimeREPL (default settings in Preferences | Package Settings | SublimeREPL | Settings - Default should be modified in Preferences | Package Settings | SublimeREPL | Settings - User, this way they will survive package upgrades!

Documentation

Very basic documentation will soon be available on RTD: http://sublimerepl.readthedocs.org/

Getting started

  • Create or open your file with code.
  • Menu / Tools / Command Palette (OS X: ⇧⌘P) then type "SublimeREPL" and select the approperiate language.
  • Menu / View / Layout / Rows: 2 (OS X: ⌥⇧⌘2).
  • Menu / View / Move File to Group / Group 2 (⌃⇧2).

Keybindings

  • Evaluate in REPL:
  • ctrl+,, s Selection
  • ctrl+,, f File
  • ctrl+,, l Lines
  • ctrl+,, b Block
  • Transfer in REPL (just copy, without evaluating it):
  • ctrl+shift+,, s Selection
  • ctrl+shift+,, f File
  • ctrl+shift+,, l Lines
  • ctrl+shift+,, b Block

Note: ctrl+,, f means: press Ctrl and Comma, release all, press F.

License and Price

Since version 1.2.0 SublimeREPL is licensed under GPL. Previous versions were licensed under BSD. If you're using SublimeREPL in commercial environment a donation is strongly encouraged ;-)

Compatibility

SublimeREPL is developed against the latest dev build of SublimeText3. Ubuntu 13.04 is main

sublimerepl's People

Contributors

edubkendo avatar emestee avatar fbehrens avatar fson avatar fukamachi avatar gclapperton avatar icholy avatar ivanca avatar laughedelic avatar lionandoil avatar mason-stewart avatar mbauman avatar mlalic avatar mvoidex avatar nomnel avatar paradigmsort avatar ppvg avatar rickasaurus avatar russplaysguitar avatar rverbitsky avatar stared avatar svieira avatar tcdowney avatar tomschenkjr avatar toph-allen avatar whitequark avatar wingedbeast avatar wuub avatar yrashk avatar ztepsic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublimerepl's Issues

F# REPL on Mac Os X (Lion)

Hi everyone,

on Mac Os X (Lion) the F# REPL can be started (after a little tweak in the config file) but it doesn't show any output.
Simple usage:

Microsoft (R) F# 2.0 Interactive build (private)
Copyright (c) 2002-2010 Microsoft Corporation. All Rights Reserved.

For help type #help;;

  • let k = 3;;

I'm expecting to see the result, but nothing shows up. I don't know if it's a problem related to my F# installation, but invoking fsi from Terminal for me works as expected.

Regards,
Alfredo Di Napoli

Python3 delays error output by one line

FROM FORUM THREAD, moved here for future generations :)

by havri on Sat Feb 11, 2012 3:15 pm

Hello!
Great plugin, great jog wuub! But I have problem with SublimeREPL when I am using Python 3. Every time I write something wrong and Python should respond with an error message, I get nothing and the error message will apear in the next call. There is an output for Python3:

>>> import foo
>>> foo.fact(6)
720
>>> foo.fact('asd')
>>> 1+1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/Utilities/foo.py", line 41, in fact
    return 1 if n == 1 else n * fact(n - 1)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
2
>>> sys.version
'3.2 (r32:88452, Feb 20 2011, 10:19:59) \n[GCC 4.0.1 (Apple Inc. build 5493)]'
>>>

When I wrote foo.fact(‚asd‘) I did not get the error message. I had to write e.g. 1+1 to get the error message. Everything is alright with Python2:

>>> import foo
>>> foo.fact(10)
3628800
>>> foo.fact('asd')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/Utilities/foo.py", line 41, in fact
    return 1 if n == 1 else n * fact(n - 1)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
>>> sys.version
'2.7.1 (r271:86832, Jun 16 2011, 16:59:05) \n[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]'
>>>

I have changed the path to Python interpreter in SublimeREPL/config/Python/Main.sublime-menu. From "cmd": ["python", "-i”] to "cmd": ["/Library/Frameworks/Python.framework/Versions/3.2/bin/python3", "-i”]. Nothing else.

Does anyone know where is the problem, please?

Default keybindings issue

The default keybindings causes problems with the ST2 standard bookmark keybindings:
{ "keys": ["f2"], "command": "next_bookmark" },
{ "keys": ["shift+f2"], "command": "prev_bookmark" },

With SublimeREPL installed, you have to sometimes press (shift+)f2 2 times to trigger the command.
Don't know if this is caused by an issue of ST2 or if it's expected to work like this.

startup, version: 2180 windows x64 channel: dev

Scala REPL doesn't die when tab is closed

If I create a Scala REPL via Tools | SublimeREPL | Scala, all is well. However, if I close the tab containing the REPL, the Scala process is left running.

I've checked a few of the other REPLs and they all seem to be dying properly when the tab is closed, so this behaviour appears to be specific to the Scala one.

Error launching REPL

Any time I try to launch a REPL, independent of language, I receive a NoReplError()

OS X 10.7.3, Sublime Text 2181, latest version of SublimeREPL

Prompts out of sequence

I've tried loading up IPython, and it seems to respond out of order. Here's an example REPL output:

Python 2.7.3rc2 (default, Apr 22 2012, 22:30:17) 
Type "copyright", "credits" or "license" for more information.

IPython 0.12.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
i = 3
3+ 2
In [1]: In [2]: Out[2]: 5
exit
In [3]: 
***Repl Closed***

Here are the two files for the menu:
Main.sublime-menu

[
     {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "r",
            "id": "SublimeREPL",
            "children":
            [
                {"command": "repl_open", 
                 "caption": "IPython",
                 "id": "repl_ipython",
                 "mnemonic": "i",
                 "args": {
                    "type": "subprocess",
                    "encoding": "utf8",
                    "cmd": ["ipython", "-i", "--nosep", "--colors=NoColor"],
                    "cwd": "$file_path",
                    "external_id": "ipython",
                    "syntax": "Packages/Python/Python.tmLanguage"
                    }
                }
            ]   
        }]
    }
]

Default.sublime-commands

[
    {
        "caption": "SublimeREPL: IPython",
        "command": "run_existing_window_command", "args":
        {
            "id": "repl_ipython",
            "file": "config/IPython/Main.sublime-menu"
        }
    }
]

Problem: Directing Sublime Text 2 Packages to the correct python installation

http://stackoverflow.com/questions/10712390/directing-sublime-text-2-packages-to-the-correct-python-installation

I just want to direct a Sublime Text 2 Package (SublimeREPL) to the correct python installation--at the moment, it's picking up the wrong one.

The story here is familiar to Mac users. The Mac OS comes includes a python install which it uses for various OS stuff for which python is required. Like many others, i prefer not to use this system python (which resides in /System/Library/...) becasue it is usually out of date and of course it's not a good idea to update it--it is a working python install used by the Mac OS, and updating risks causing those OS tasks that depend on that install to break.

But that's the version picked up by the package SublimeREPL:

Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

The version i use for development (and which is installed in /Library/Frameworks/ and symlinked to /usr/local/bin) is:

@ > python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Sublime 2 Text is picking up the correct version elsewhere, except when using the SublimeREPL Package so there must be a setting in one of the config files in that Package that will let me direct SublimeREPL to the correct python.

But i can't find it.

It seems that i have exhausted all plausible options, which, looking through my /Sublime Text 2/Packages/ directory must reside in either:

SublimeREPL/

    SublimeREPL (OSX).sublime-settings
    SublimeREPL.sublime-settings

Or

User/

    SublimeREPL.sublime-settings

In fact, i added the following each of the three JSON files above, with no effect:

{
    "default_extend_env": {"PATH": "/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin/python2.7:{PATH}"}
}

Support for custom python installs and virtualenv

Hi, I installed Python 2.7.3 via Homebrew on OS X Lion.
I have changed /System/Library/Frameworks/Python.framework/Versions to point to /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/Current as suggested by http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/

I have two problems:

I would like SublimeREPL to use Python 2.7.3 instead of the version of 2.7.1 that came with the system. When I type "python" in the terminal the right version gets launched.

I also would like to use the virtualenv configurations I set up. In the terminal I can switch to a virtualenv by typing "workon datacleaning".

I have managed to get SublimeREPL to use the right virtualenv by replacing every instance of
"cmd": ["python" ...
with
"cmd": ["/Users/USERNAME/.virtualenvs/datacleaning/bin/python" ...
in the file
/Users/USERNAME/Library/Application Support/Sublime Text 2/Packages/SublimeREPL/config/Python

This however is a very hacky solution that will likely break with the next update.
Furthermore, it still runs Python 2.7.1 instead of the version I want.

Any help would be very much appreciated.

Commands Sent to R only show ">"

When I send a line or a selection of an R script to SublimeREPL in windows, all I get is an ">" instead of the text that I sent. Having the lines of code shown in the REPL is useful because you can go back and see what you did and look at your history. This does work correctly in OS X. Can you get this to work on windows?

Coffeescript REPL fails to load: "[Error 193] %1 is not a valid Win32 application"

I'm running win7 64-bit with Node.js installed using the .msi file from nodejs.org. I installed CoffeeScript via NPM.

I got this error message when I tried to run CoffeeScript with SublimeREPL even though coffee works fine on the command line:

WindowsError: [Error 193] %1 is not a valid Win32 application.

Looking this up, I found this explanation. I was able to make it work by changing one line in Packages\SublimeREPL\config\CoffeeScript\Main.sublime-menu ():

"cmd": ["node", "C:/Users/me/AppData/Roaming/npm/node_modules/coffee-script/bin/coffee"],

You may want to have SublimeREPL check for users who are set up this way.

Some characters not printed properly

I tried using npm ls, shich should print the following (in the directory I used it in)

├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected].
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── formidable@1
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── express-expose@0
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── connect-roles@0.
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── formidable@1
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── express-namespac
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ passport-browser
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── passport-dummy@0
├── [email protected]
└── [email protected]

But instead printed

├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── [email protected] extraneous
├── [email protected]
└── [email protected]

Loading of haskell file

Hi, not really an issue but unsure where to post.

Is there a way to get a haskell file to load into the repl from a key press ?

From what I can tell you can just a copy/paste with the key combo but that obviously doesn't work for the contents on a haskell file in a repl.

Can I get the repl to load a file ??

Thanks

Node REPL not working for v0.8

It yelds this:

repl.js:89
    stream = options.stream || options.socket;
                    ^
TypeError: Cannot read property 'stream' of null
    at new REPLServer (repl.js:89:21)
    at Object.exports.start (repl.js:331:14)
    at /Users/dresende/Library/Application Support/Sublime Text 2/Packages/SublimeREPL/config/NodeJS/repl.js:11:7
    at Object.<anonymous> (/Users/dresende/Library/Application Support/Sublime Text 2/Packages/SublimeREPL/config/NodeJS/repl.js:12:3)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:487:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

***Repl Closed***

"shell" command disfunctioned when i run the python script below...

python script:

coding=utf-8

from sys import argv

script, user_name = argv
prompt = '>'

print "Hi %s, I'm the %s script." % (user_name, script)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % user_name
likes = raw_input(prompt)

print "Where do you live %s?" % user_name
lives = raw_input(prompt)

print "What kind of computer do you have?"
computer = raw_input(prompt)

print """
Alright, so you said %r about liking me.
You live in %r. Not sure where that is.
And you have a %r computer. Nice.
""" % (likes, lives, computer)

Instead of printing line by line, the sublimeREPL print it together after you input all the three information
the most wired thing is when you type “python filename.py Zed" in the command line and hit Enter, there's nothing happened. you must continue typing three input as i set in the script, then it will show all the results.

But it did ok when i use the system terminal. I think it may be a bug.

Include fixed version of manual executable search on windows

def win_find_executable(executable, env):
    """Explicetely looks for executable in env["PATH"]"""
    if os.path.dirname(executable):
        return executable # executable is already absolute filepath
    path = env.get("PATH", "")
    pathext = env.get("PATHEXT") or ".EXE"
    dirs = path.split(os.path.pathsep)
    (base, ext) = os.path.splitext(executable)
    if ext:
        extensions = [ext]
    else:
        extensions = pathext.split(os.path.pathsep)
    for dir in dirs:
        for extension in extensions:
            filepath = os.path.join(dir, base + extension)
            if os.path.exists(filepath):
                return filepath
    return None

In telnet mode, lots of funny characters

(This is for version 1.0.20).

In Clojure, when stack traces are printed and I'm connected to a REPL via TCP, the text doesn't print cleanly in SublimeREPL. For example:

jamsession.main=> �[31mclojure.lang.Compiler$CompilerException: �[39m�[31mjava.lang.RuntimeException: Unable to resolve symbol: op in this context, compiling:(NO_SOURCE_PATH:38)�[39m
�[36m Compiler.java:6235 clojure.lang.Compiler.analyze�[39m
�[36m Compiler.java:6177 clojure.lang.Compiler.analyze�[39m
�[36m Compiler.java:3503 clojure.lang.Compiler$InvokeExpr.parse�[39m
�[36m Compiler.java:6411 clojure.lang.Compiler.analyzeSeq�[39m
�[36m Compiler.java:6216 clojure.lang.Compiler.analyze�[39m
�[36m Compiler.java:37 clojure.lang.Compiler.access$100�[39m
�[36m Compiler.java:5837 clojure.lang.Compiler$LetExpr$Parser.parse�[39m
�[36m Compiler.java:6409 clojure.lang.Compiler.analyzeSeq�[39m
�[36m Compiler.java:6216 clojure.lang.Compiler.analyze�[39m

Python process not killed after tab is closed / Ubuntu

http://www.sublimetext.com/forum/viewtopic.php?p=30904#p30904

Hi,

I use SublimeREPL with Python all the time. Its great. But I have recently found an issue with memory not being released. When I close a REPL tab it does not kill the process. If I check in 'system monitor' it says 'sleeping' and 'pipe-wait', and the memory is still tied up.

To reproduce it:

  • Open a REPL python tab.
  • Do something that consumes a lot of memory, such as:

    data = np.asarray([i for i in xrange(1000 * 10000)]).reshape(1000,10000)

  • close tab.
  • the process is not killed, and the memory is still locked up, until I go into 'system monitor' and manually kill it.

I'm on Ubuntu. I'm afraid I don't know too much about killing processes, otherwise I'd try and sort it myself.

Many thanks.

(by the way I continue to use PDB, this way and its also great, aside from this issue!)

Weirdness using Pry as Ruby REPL

When I try to set SublimeREPL to use Pry for my Ruby REPL I get some odd behavior.

I get an interactive session, however I don't get any output from pry until I explicitly exit. I can type in commands however the buffer resets in most cases. Once I type exit I see the output from my session but not before then.

I'm on OS X 10.7.4

Doesn't respond to new lines

For me, SublimeREPL doesn't work. The process opens and I can type text, but pressing 'enter' doesn't do anything except insert a new line. Running a buffer with no interaction (e.g. Python run buffer) works fine.

Linux Mint 12 64 bit
ST build 2181

Happy to do more testing and give more details if you can point me at what would be useful.

Autoclose tab on exit

Feature request: When I exit a REPL, the tab should autoclose. For example, calling .exit in Node should close the tab.

start windows shell fail with error

I'm using sublimetext2 on windows 7 x64. Trying to open shell from Tools -> SublimeREPL -> shell fails with error
LookupError('unknown encoding $win_cmd_encoding',)

Send code to REPL by the paragraph

As I mentioned on the Sublime Text forums, this would be very useful in a lot of contexts, particularly (for me) in Clojure. The patch is so small I'll just provide it here:

in text_transfer.py, in class ReplTransferCurrent, add this method:

# Ignores multi-selection; grabs the first selection or cursor position
def current_paragraph(self):
    v = self.view
    for s in v.sel():
        return v.substr(paragraph.expand_to_paragraph(v, s.begin()))

Within the run method, add this clause:

    elif scope == "paragraph":
        text = self.current_paragraph()

And add a keymap so it's usable.

Opening clojure REPL fails / Fix PATH problems

I keep seeing "[Errno 2] No such file or directory" failures when I try to open the Clojure REPL. Mac OS 10.7.

I'm guessing it's failing to find leiningen. However, lein is definitely on my PATH, at /usr/local/bin/lein . Does Sublime Text have a different set of PATHs than the ones I have in a bash shell?

Return of Ruby support

If Ruby support is not returned immediately, we, the undersigned, are going to Occupy Wuub's Cubicle for the duration.

... I mean, could Ruby support be pretty-please fixed up? I tried adding it back, but it doesn't fetch the irb prompt. I suspect that's related to your pexpect-vs-subprocess comment on the forum.

Output that contains tabs causes problems when replaced by spaces

It appears that shell command output containing tab characters causes the output end position to be messed up when those tabs are replaced by spaces by Sublime Text 2. I.e., when the

"translate_tabs_to_spaces": true

setting is present for text files (or default).

I can reproduce it on my Mac by running the SublimeREPL | Shell command to get a bash REPL, then running "ls -C /etc". This command uses tabs to separate the columns of output. The output is fine, but then when I do (say) a "w" command next, it thinks that the command starts in the middle of the "ls -C" output rather than at the last prompt.

I think the problem is caused by

        self._output_end += len(unistr)

in ReplView.write() in sublimerepl.py since that statement assumes that the number of characters in the command output is equal to the position adjustment in the buffer, which is not true if tabs have been replaced by spaces when the output is inserted into the buffer.

It seems to be fixed by replacing that line with

        self._output_end = self._view.size()

error: WindowsError(5, 'Access is denied.')

With the recent version of SublimeREPL (v1.0.31) on Sublime Text 2 (Windows 7 32-bit), I am always getting the error "error: WindowsError(5, 'Access is denied.')", whenever I try to run Python REPL or Node REPL. I have not tried REPLs of other languages.

This problem was not happening with the previous version of SublimeREPL. Even after uninstalling, rebooting Windows 7 and installing SublimeREPL, this WindowsError is repeatedly coming. In other words it is no longer possible to use SublimeREPL on Windows 7 32-bit with Sublime Text 2. I have to uninstall SublimeREPL v1.0.31 for good.

I have always used SublimeREPL through http://wbond.net/sublime_packages/community. Please provide the previous version in http://wbond.net/sublime_packages/community.

Tab-completion

Some repl's support tab-completion for example Haskell's ghci.
It would be great if pressing tab would translate to a tab completion command similar to how command history is handled.

Quick enter keybinding

i've found i needed command like this

class ReplQuickEnterCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.run_command("move_to", {"to": "eof"})
        self.view.run_command("repl_enter")

mapped to "insert line after" shortcut (super+enter) in cases where i edited expressions and had to move the caret at end of line and then hit enter.
maybe the command name is a bit of but just wanted to share it.

[Clojure] Strange output

When entering a command in SublimeREPL (using Clojure 1.4.0 and leiningen 2 preview 6 on Ubuntu 12.04) I get a strange output after pressing ENTER:

user=> (+ 2 4)
(+ 2 4)�[14G�[8G�[15G
6

Obviously the second line shouldn't be printed. This doesn't happen when executing the commands from a standard terminal.

Hiding autocompletion with GHCi

How to reproduce:

  1. Run REPL for Haskell
  2. Enter :type foldr1 and press [Enter]
  3. Enter :type foldr and observe autocompletion

In step 3 you shall get autocompletion suggestion. If you try to get rid of it with [Esc], whole line disappears. Obviously this is not the intended behaviour, as [Esc] in such case should only hide autocompletion suggestion.

Can't stop node server on windows

I'm trying to run a node website using windows by typing

node app.js

Into the shell REPL

Normally I then close it using cntrl+c, but this doesn't work, any suggestions?

Use "alt-up" and "alt-down" for repl_view_previous and next

On Mac OS X, I noticed that Sublime Text by default doesn't use alt+up or alt+down, so I use them in Default (OSX).sublime-keymap. It works fine; I would recommend it as the default, in fact.

{ "keys": ["alt+up"], "command": "repl_view_previous",
"context":
    [
        { "key": "setting.repl", "operator": "equal", "operand": true }
    ]
},
{ "keys": ["alt+down"], "command": "repl_view_next",
"context":
    [
        { "key": "setting.repl", "operator": "equal", "operand": true }
    ]
}

I also use (and recommend) super+enter to send blocks to the REPL, as this is quite intuitive, and happens to be already used in some other REPL-ish tools.

{ "keys": ["super+enter"], "command": "repl_transfer_current", "args": {"scope": "block"}},

Python menu item missing

In Tools > SublimeREPL the Python entry is missing. I have no idea what the problem is yet; I have tried looking at it a copule of times with no luck. It seems that the Python menu looks okay, yet it is still not showing (maybe some other child entry is bad and causing issues).

It does this on my Windows 64 at work, and my Mac at home. I have tried reinstalling SublimeREPL and it has made no difference.

Non readable error message

I've tried to start REPL for groovy and got an error dialog with unreadable message:

WindowsError(2, '\xcd\xe5 \xf3\xe4\xe0\xe5\xf2\xf1\xff \xed\xe0\xe9\xf2\xe8 \xf3\xea\xe0\xe7\xe0\xed\xed\xfb\xe9 \xf4\xe0\xe9\xeb.')

Probably you incorrectly display localized strings?
My environment: ST2, Windows 7 Professional x64, Russian

According to error code 2 the text must be "Не удается найти указанный файл.".

Carriage return characters in views (Windows)

[[ Move from bitbucket ]]

This happens running SublimeText2 on Windows XP:

When using the REPLs Python, Lua, and CMD (at least), carriage return characters ('\r') get written to each line end in the REPL's buffer, and they appear as empty squares.

I've removed this small annoyance, by changing ReplView's "write" method to this:

def write(self, unistr):
    """Writes output from Repl into this view."""
    # string is assumet to be already correctly encoded
    v = self._view
    edit = v.begin_edit()
    try:
        if sublime.platform() == 'windows':
            unistr = unistr.replace('\r\n', '\n')
        v.insert(edit, self._output_end, unistr)
        self._output_end += len(unistr)
    finally:
        v.end_edit(edit)
    self.scroll_to_end()

The only modification are those two lines checking for Windows, and replacing '\r\n' by '\n'.

Not sure if this is the best way of fixing this, but it works, and makes REPLs prettier.

Thanks for this wonderful plugin!

Oscar.

Clearing the screen kills the REPL? (Ruby)

Hello,

I notice if I select all the text and delete it, this kills the REPL at least for Ruby. I don't seem to be able to get the prompt back or execute any additional code. Is there a different way to clear the screen? Or is it possible to reload the REPL?

This appears to be an issue with Ruby but not Python. In Python REPL, if I clear the screen and press enter a few times, I get the prompt back.

Thank you,
Corsen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.