rshell - Remote Shell
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: rshell - Remote Shell
It even does file transfers to the Pico on this laptop. This proved troublesome with the old version.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: rshell - Remote Shell
Thank you Dave - that’s great
Re: rshell - Remote Shell
I think I screwed up the 0.0.29 release - I messed up my merge.
So I created 0.0.30.
So I created 0.0.30.
Re: I suggest macros
Awesome! however somehow I am unable to install your version, I am getting version 0.0.30.pythoncoder wrote: ↑Sat Feb 27, 2021 2:45 pmAs mentioned above, I have a fork of rshell providing text macros documented here. The macros can be arranged to load when rshell starts. I have an alias for each project which exports an environment variable: this ensures that rshell imports a set of macros for that project when it starts up. I can then issue (say)which changes to the correct source directory and performs an rsync to (in this case) /pyboard/drivers. You could define a macro for each of your standard directories.Code: Select all
> m drivers /pyboard
The macro facility has transformed my use of rshell: it saves a lot of errors and greatly simplifies the maintenance of multiple bigger projects.
Code: Select all
rshell: error: unrecognized arguments: -m
Re: I suggest macros
Awesome! however somehow I am unable to install your version, I am getting version 0.0.30.pythoncoder wrote: ↑Sat Feb 27, 2021 2:45 pmAs mentioned above, I have a fork of rshell providing text macros documented here. The macros can be arranged to load when rshell starts. I have an alias for each project which exports an environment variable: this ensures that rshell imports a set of macros for that project when it starts up. I can then issue (say)which changes to the correct source directory and performs an rsync to (in this case) /pyboard/drivers. You could define a macro for each of your standard directories.Code: Select all
> m drivers /pyboard
The macro facility has transformed my use of rshell: it saves a lot of errors and greatly simplifies the maintenance of multiple bigger projects.
Code: Select all
rshell: error: unrecognized arguments: -m
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: rshell - Remote Shell
To install my version you need to clone my repo onto your PC. Create a directory, move to it, and issue:
[EDIT] These instructions are wrong. Please see later post.
Then copy the file rshell/main.py over the original main.py, also replace README.rst. You can locate the original with
It will still report V0.0.30 but should respond to e.g. lm
Once you've tested it you can remove the directory tree with the clone.
I will update my version of the README to clarify this.
Code: Select all
git clone https://github.com/peterhinch/rshell
Then copy the file rshell/main.py over the original main.py, also replace README.rst. You can locate the original with
Code: Select all
[adminpete@capybara]: ~
$ which rshell
/usr/local/bin/rshell
Once you've tested it you can remove the directory tree with the clone.
I will update my version of the README to clarify this.
Last edited by pythoncoder on Tue Jul 20, 2021 1:58 pm, edited 1 time in total.
Reason: I made a mistake in my instructions
Reason: I made a mistake in my instructions
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: rshell - Remote Shell
Thanks Peter for the prompt answer. /usr/local/bin/rshell is a single file on my installation, with in it:
How could it be replaced with what I have cloned? Thanks.
Code: Select all
#!/usr/bin/python
import re
import sys
from rshell.command_line import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: rshell - Remote Shell
I'm sorry - you are right - my installation is nonstandard as I have other modifications to rshell.
That file is just a stub. The actual installation will be in a directory of the form
where 3.x is your Python 3 installation. You'll need to replace main.py and to make my README.md accessible via a weblink or otherwise.
That file is just a stub. The actual installation will be in a directory of the form
Code: Select all
$ find /usr -type d -name "rshell" -ls
15206589 4 drwxr-sr-x 3 root staff 4096 Sep 27 2019 /usr/local/lib/python3.6/dist-packages/rshell
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: rshell - Remote Shell
Another mod which may or may not be of interest may be found in the no_pc_delete branch of my repo. Though I manage to use bash daily without disaster, in rshell I have twice deleted my project from the PC rather than from the target. In addition to the macro feature this branch refuses to delete files or directories on the PC.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: rshell - Remote Shell
Thank you Peter, this is a great addition.
I'ven't try the version in your no_pc_delete branch yet.
I'ven't try the version in your no_pc_delete branch yet.