henrikpersson / rsub Goto Github PK
View Code? Open in Web Editor NEWUse rmate with Sublime Text.
Use rmate with Sublime Text.
A new window should be created when no window exist and always if open_files_in_new_window is set to true.
Sublime text should also be brought forwards and get focus.
Sublime text 3 has window class subl3.Subl3. Changing it in wmctrl command in source fixes this. I'm not sure though, does this extension support subl2 still?
Last commit in 2017, multiple issues and what not since then. Is this project still maintained?
When working with long files, they are truncated at different lengths when saved.
Edit: Only occurs with the bash script, ruby seems fine
Running rmate (1.5.8) installed via gem on Debian 8, Ruby 2.1.5. Known issue? ๐
When I open a large css file (over 2900 lines) using the ruby version of rsub, and then save it, a diff of the files shows that every line in the file has been modified, even if I haven't changed a thing in the file.
This only occurs with large files. Other css files or other type of files do not have this issue.
I frequently use rsub to edit files on my desktop while I'm away from home. However, if I leave Sublime (with rsub installed) running on my desktop and then try to rsub the file to my laptop, it opens the file in Sublime on my desktop and not my laptop. Not sure there is a great way around it, but I thought I'd put this out there.
If there is no open window when an incoming connection is received, rsub already creates a one.
This is a request for an option which makes rsub open files always in a separate window.
Ideally rsub would assign a window to itself, and open all files in that window.
rmate [existing_file] opens as it should in both textmate2/3 for me
rmate[non_existing_file] produce no results at all. expected result open a new blank file in sublime (?) (Mountain Lion / Debian)
edit:
this was a problem with rmate not submitting any data at all when file was not existing, seems that sublime needs both size=0 and and empty string to open a blank document.. i don't know if this is specific for sublime and does not apply to textmate so i just forked the submodule and fixed it here https://github.com/m4rkus/rmate
problem solved ;)
I have changed rsub default port and it works great. I'm on a debian machine.
But when I try to change root priveligied files with sudo or in root user it doesn't work.
It says:
/usr/local/bin/rsub: connect: Connection refused
/usr/local/bin/rsub: line 327: /dev/tcp/localhost/52698: Connection refused
Unable to connect to TextMate on localhost:52698
It appears that on root user rsub tries to use the default port instead of the one that i'm using.
Hope that someone can give me some feedback.
Thanks
Please help! =(
[~]> cat ~/.ssh/config
Host router
User me
HostName 192.168.1.1
Port 65000
RemoteForward 52698 localhost:52698
[~]> ssh router
ASUSWRT-Merlin RT-AC5300 384.8-2 Sat Dec 8 18:19:13 UTC 2018
me@RT-AC5300-EC70:/tmp/home/root# /opt/bin/rsub ~/test.txt
/opt/bin/rsub: connect: Connection refused
/opt/bin/rsub: line 393: /dev/tcp/localhost/52698: Connection refused
me@RT-AC5300-EC70:/tmp/home/root#
WTF!?
Tried to dump all iptables rules. No luck =(((
logger "Setting default filter policy"
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
logger "Flushing all rules"
#-F flushes all the chains. Chains can't be deleted unless they are empty
iptables -F
#-X Delets all the non-builtin chains in the table
iptables -X
#-Z Zero's the packet and byte counters in all chains
iptables -Z
Hint must show remoute filename
When using wakatime plugin we can create developers time which he spent to this or that project.
Thus, when switching to different project in sublime: Project->Switch project...
. We should open files from different directory to count time as ProjectX
instead of ProjectY
This is done in waka time by configuring that /home/user/project/X
belongs to ProjectX project and /home/user/project/Y
to ProjectY
Allow to put some configurations into xxx.sublime-project
configuration file so rsub will open remote files (save them temporary) under /user/home/project/X/remote
directory:
rsub: {
tmpdir: /user/home/project/X/remote
}
[rsub] Server running on localhost:52698...
[rsub] New connection from ('127.0.0.1', 60955)
Traceback (most recent call last):
File "./rsub.py", line 77, in on_done
KeyError: 'display-name'
Installed via Package Control.
I'm not sure if this is an rmate issue or something with rsub implementation but on some systems it seems the hostname:file is showing in Sublime but on others its just hostname.
What exactly determines this? I've tried to upgrade to a later version of ruby on the system that it doesn't work on and it didn't make a difference.
So when I use package control to install this in sublime (on a mac) bit the rmate- sub directories ends up empty. So I have no file to copy to the remote server
If you add:
alias subl="rmate $1"
to your remote ~/.bash_profile then typing subl foo.txt
in an ssh shell will open foo.txt locally using Sublime Text. Of course if Sublime Text is also installed remotely then this will override the normal subl command but it might be worth noting this in the readme for people who only have Sublime installed locally.
When using rmate with symlinks, I only receive the first or two lines of the file.
Using rmate directly on the file works though.
Can someone replicate this?
Sublime Text 3061
rmate, bash version
Not sure what I may have done wrong (followed this: http://danieldemmel.me/blog/2012/09/02/setting-up-rmate-with-sublime-text-for-remote-file-editing-over-ssh/), using a custom 2224 port.
Opening remote files works perfectly but ctrl-s
in sublime text 2 does not impact the remote file. Any idea what might be going on?
Hi,
Thanks so much for this wonderful plug in!
I'm using rsub on a local machine running OSX 10.7 and a remote server running Ubuntu 12.04.5
One thing that I've noticed is that there is practically no information about how to "shutdown" rsub should you lose your connection with the server you are working on remotely (or some other reason). Of course, the better thing for me to do is to use this with something like tmux which would keep it running. However, recently I haven't been using it and naturally, after a while the pipe breaks. If this happens, after you log back in to the remote server, rsub won't open the file, instead you just get something like this:
user@server: rsub yourfile.html
[]
And you have to ctrl-c to get back to the shell.
Or, you'll get something like this:
/usr/local/bin/rsub: line 301: /dev/tcp/localhost/52698: Connection refused
Unable to connect to TextMate on localhost:52698
I've googled up and down about it (and of course restarted ST2), and surprisingly while there are tutorials on how to use rsub, no one mentions what to do if it stops working. There's a post on SO that recommends killing the process by searching using netstat:
sudo netstat -antpl -p | grep 52698
sudo kill -9 xxxx
But this only works about half the time.
Any advice you have on this would be great.
Thanks again,
Benjamin
I'm having a bit of issues getting this to work. I don't have superuser privileges on my remote machine so I did ~/rsub instead of /usr/local/bin, but this didn't work. When I type rsub filename.py after ssh-ing into my remote machine, I get error "-bash: rsub: command not found". My .ssh/config has the remote forwarding lines added to it. Any idea what I've done wrong?
If you look into your code:
58:
host = localhost
....
88:
if [[ "$host" = "auto" && "$SSH_CONNECTION" != "" ]]; then
echo "HERE"
host=${SSH_CONNECTION%% *}
fi
You can notice that at line 88 $host is always localhost. It seems this code must be after command line option processing
I often work or remotely or direct.
And I switch my EDITOR env variable beetween 'rsub' and local editor.
Please implement 'RSUB_FALLBACK_EDITOR' which will contain editor (or command) to run when rsub port is not accessible.
This let just work and do not think about EDITOR env
This is the output i get on the console when trying to rmate
Exception happened during processing of request from ('127.0.0.1', 63362)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 560, in process_request_thread
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 322, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 617, in init
self.handle()
File "./rsub.py", line 118, in handle
File "./rsub.py", line 42, in parse_input
ValueError: invalid literal for int() with base 10: 'users'
I had to use a git clone --recurse-submodules
to get these folders.
When I open file remotely I want my local editor show this file and I am not required to click by mouse on task panel to switch from remote console to editor
The rmate url for ruby needs to be fixed to the following as current URL isn't valid anymore:
Looks like its importing osx specific modules from python
Traceback (most recent call last):
File "./sublime_plugin.py", line 62, in reload_plugin
File "./rsub.py", line 8, in
from ScriptingBridge import SBApplication
Whenever I open a file with rsub and save it, any empty lines are the bottom of the file are removed. I would prefer to remove these only by choice not automatically on save.
Edit: using the ruby version
rsub seems to work with sublime text 3, but it's using the sublime text 2 bundle identifier to bring the window to the front, so that aspect isn't working.
When ssh connection have lost. you must notify about that.
Without that all editing goes to /dev/null
I was wondering if there's a way to open a complete folder using rsub
When connecting to IPv6 remote hosts, I get an error using rmate:
connect_to 127.0.0.1: unknown host (nodename nor servname provided, or not known)
If I change RemoteForward 127.0.0.1:52698 127.0.0.1:52698
to RemoteForward 127.0.0.1:52698 localhost:52698
, I get this:
connect_to localhost port 52698: failed.
This is because rsub isn't binding tcp6 port 52698 on my local computer:
$ netstat -anl | grep 698
tcp4 0 0 127.0.0.1.52698 *.* LISTEN
A terrible workaround:
socat TCP6-LISTEN:52698,fork,bind=[::1] TCP4:127.0.0.1:52698
Is there a nice way to add IPv6 support to rsub?
Hello, I sometimes have multiple ssh sessions open at the same time. I have the forwarding port different for each server I'm connected to. To switch servers for rsub, I have to change the port every time I want to use rsub on a different server.
Could a feature be added to where I can add a list of ports rsub is listening to? Or is it possible to do this already?
Thanks!
when i open a file sublime doesnt come in to the foreground
(Ubuntu 12.04 + Gnome3)
TextMate pops to the front when a file is open.
Is there a way of making sublime do the same?
Maybe through applescript..?
Hello,
I would like to request to add a feature: when connection is lost or writing to remote server gets failed, pop up a message box or give some message at the bottom of Sublime Text window?
Currently there is no warning for such a scenario:
Sublime Text 3 + macOS 10.13
Thanks!
I only see code to handle osx and linux platforms. Is windows supported now, or is it planned for the future?
When I use rmate to open a file I often get a partial (the first few lines) file opened in the editor. Any ideas?
Rmate can add multiple files in the command line, but only one of them be opened by sublime.
Not sure why you do not include user settings at all, makes changing the port a real pain in the fucking ass.
Hi, Like the title, rsub doesn't seem to recognize server git checkout changes. Is this something you plan to have in the future release? If not, I can work on this feature and probably will need some guidance from you. Thanks!
I'm trying to use rsub with multiple computers on the same server, however, it only works for one. When I try to use it from other computers, files are opened in the first computer. I tried following the instructions in the Port Forwarding section of this blog. But couldn't solve it. Any suggestions?
when opening same file second time you must focus tab with already opened this file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.