Your Digital Media Has Never Looked So Good

 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Fri Jan 15, 2016 3:06 pm

On PuTTY, I can't even get the left and right arrow keys to work. If you press the left-arrow key, for example, it echoes back: ^[[D.

On dtelnet, when you enter a command at the BrightScript prompt, e.g. "help", it sends: "BrightScript Debugger> help" to the Roku.
https://github.com/belltown/
 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Command line Editing in Console?

Fri Jan 15, 2016 3:09 pm

I doubt there is a "Windows telnet client with command history". I've looked and could not find one. puTTY is bee's knees and if it does not have it, then nobody does. Another one plainly says 'ConEmu is not a shell, so it does not provide “shell features” like tab-completion, command history and others.'

But neither do telnet clients for for OSX/*nix have a history support. I imagine that's because most everywhere it's done server-side already - e.g. i remember Cisco (and alike) CLI do.

You are lucky to have that rlwrap wrapper. Our of curiosity, doesn't it cause issues with "hot keys" like ctrl-C and ctrl-S? Like having to hit Enter after ctrl-C to interrupt.
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Sat Jan 16, 2016 11:36 pm

EnTerr wrote:
RokuJoel wrote:
... The Eclipse plugin, if you can get it working, is a major improvement in many ways though:

Right, "if you can get it working" :wink:. Its dependence to particular version of Eclipse and general fragility have dissuaded me from touching it with a 10-foot pole. It's a systemic problem - complex systems break in complex ways - and i don't want to spend most of my time chasing peripheral problems (like crummy IDE module dependencies) from becoming central (breaking development).


Sums up my experiences too.

Attempt #4, and I hadn't even got to the part where you install the BrightScript plugin:

Image
Last edited by belltown on Fri Feb 12, 2016 12:02 pm, edited 1 time in total.
https://github.com/belltown/
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Mon Jan 18, 2016 2:31 pm

For the Windows, non-Eclipse-using, Roku developers, I've put together a Windows Roku Debugger client that supports line-editing, command history, and Unicode debugger output. It's a Python 3.5 program, roky.py.

You can get roky.py from https://github.com/belltown/roky There's documentation at http://belltown-roku.appspot.com/Roky and on GitHub.

I've been using it with CMD.EXE, PowerShell, and MinGW without issues. It's Windows-only unless someone wants to port it to a Mac.

Unfortunately, because of the way the Windows Console works, and the fact that Python's readline implementation is blocking with no provisions for being interrupted, I had to use two independent console Windows, one for debugger commands, and one for debugger output, otherwise you wouldn't be able to display debugger output until the user pressed the enter key. Still, the 2nd window is created automatically, and you can move and resize both windows to make it easier to enter debugger commands in the small window, and view the output in the large window.

Hopefully, some of you may find it useful. If anything, it gave me an excuse to start learning Python. I may look into developing a better GUI implementation later that can handle multiple tabs with a debug session in each tab.
Last edited by belltown on Fri Feb 12, 2016 12:03 pm, edited 1 time in total.
https://github.com/belltown/
 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Command line Editing in Console?

Thu Feb 04, 2016 1:23 am

belltown wrote:
For the Windows, non-Eclipse-using, Roku developers, I've put together a Windows Roku Debugger client that supports line-editing, command history, and Unicode debugger output. It's a Python 3.5 program, roky.py.

You can get roky.py from https://github.com/belltown/roky There's documentation at http://belltown-roku.appspot.com/roky.html and on GitHub.
...
Hopefully, some of you may find it useful. If anything, it gave me an excuse to start learning Python. I may look into developing a better GUI implementation later that can handle multiple tabs with a debug session in each tab.

Just started learning Python, you say? Wow.
I had a glance - great "penmanship"! Well documented. Just one note, you can get short names like so:
from ctypes.wintypes import BOOL, UINT, ULONG, WCHAR, HANDLE, SHORT, DWORD
from Win32 import GetFileType, GetStdHandle, WriteConsoleW, GetConsoleMode, GetCurrentConsoleFontEx, SetCurrentConsoleFontEx
Haven't tried it, lazy to fire up windows machine. Should remember looking at this for example use of Win32.

GUI you say? If you are good at that, why don't you go work for RokuCo and write them a proper IDE? They have been posting for years job listings for someone to write said IDE...
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Thu Feb 04, 2016 11:02 pm

Thanks for the tip on the 'from ... import' statement, EnTerr. It would seem very appropriate in that case. I remember coming across it, but didn't look into it further as I'd already got my basic imports working.

I've been looking into doing a GUI debugger wrapper. It has a lot more potential than my Python attempt (in addition to the command history and logging: multiple tabs for different Rokus/ports, discovering the Rokus on the network, a drop-down menu listing all the Roku ports, a clear-screen key, ... -- probably stuff that Eclipse already has, if I hadn't given up on trying to get it working).

I've never thought that Roku needed a full-blown IDE, although I haven't personally worked on anything that I thought would benefit from that. A "Roku IDE" would probably have to be platform-independent, which is what Eclipse claims to be -- if you can get it to work. If I was really interested in such a project, I'd probably write a Visual Studio extension, since that's what I've been using for most of my development recently.
https://github.com/belltown/
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: Command line Editing in Console?

Sun Feb 07, 2016 1:11 am

belltown, I finally got around to trying your Windows Roku Debugger. This is fantastic! You are my hero. :mrgreen: <- green with envy. I was going to put in a request for command recall, but then I thought I'd take a look at the code and try to add it myself as a small contribution. If that's your first attempt at Python coding, I'm very impressed. I've been futzing around with Python for years (mostly modifying others' code) and I couldn't begin to put something like that together. Anyhoo, I realized you're using the Windows console somehow and command recall is already built in. Just type a few characters of the command you want to recall and press F8. I don't find the two windows aspect much of an issue at all. It takes a little getting used to and I did find myself looking at the wrong window a few times, but I'm sure the more I use it the less that will happen.

My sincere thanks!
-JT
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Sun Feb 07, 2016 9:50 pm

renojim wrote:
I realized you're using the Windows console somehow and command recall is already built in. Just type a few characters of the command you want to recall and press F8.

Thanks, JT. I had no idea that F8 would give you command-completion in the Windows console. I also just discovered that F7 will give you a pop-up list showing all your previous commands; you can scroll though with the up/down keys and pick the one you want.
https://github.com/belltown/
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: Command line Editing in Console?

Sun Feb 07, 2016 11:07 pm

Ah, I forgot about F7. I've been using the JPSoft command line replacement products since the DOS days. I've never understood why everyone doesn't just use the up/down arrows for command completion like they've been doing for decades (I'm looking at you bash!).

-JT
 
User avatar
Komag
Posts: 808
Joined: Fri Aug 22, 2014 3:42 am

Re: Command line Editing in Console?

Mon Feb 22, 2016 11:32 am

I really like the GUI belltown, used it a few hours today, so clean and simple and WAY better that using Eclipse just for command line!!! :oops: :mrgreen:

So far it works great (install was tricky with my anti-virus)
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Tue Mar 01, 2016 11:55 am

My graphical interface to the Roku Debugger is now available for public use. It's called PurpleBug. You can find it here: http://belltown-roku.tk/PurpleBug

Hopefully, Windows users will find it useful. Just click the "Install PurpleBug" button to download the installer. Be advised that it may not install if your anti-virus protection is turned on. You may need to disable anti-virus protection before you run the installer. The same applies whenever a new update is to be installed. Apart from that, let me know if you have any problems with it.

PurpleBug features multiple tabs allowing multiple simultaneous debug sessions to different Rokus and ports. There's a drop-down menu for the Roku ports in case you forget which port the screensaver runs on, for example. The Rokus on your network should be discovered automatically, so you don't have to type in the IP address each time; just click the device you want to debug. In the command window, the up/down keys can be used to cycle through your command history. The tab key can be used to cycle through commands starting with characters already typed on the command line. You can also define 10 shortcuts for commonly used debugging commands. The Rokus' output windows have an unlimited size and can also be logged to a file. You can choose whether or not the output windows scroll automatically, and whether or not line wrapping is enabled. There are also Clear Screen and Clear Line keys.
https://github.com/belltown/
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Command line Editing in Console?

Tue Mar 01, 2016 3:03 pm

belltown wrote:
My graphical interface to the Roku Debugger is now available for public use. It's called PurpleBug. You can find it here: http://belltown-roku.tk/PurpleBug

Hopefully, Windows users will find it useful. Just click the "Install PurpleBug" button to download the installer. Be advised that it may not install if your anti-virus protection is turned on. You may need to disable anti-virus protection before you run the installer. The same applies whenever a new update is to be installed. Apart from that, let me know if you have any problems with it.

PurpleBug features multiple tabs allowing multiple simultaneous debug sessions to different Rokus and ports. There's a drop-down menu for the Roku ports in case you forget which port the screensaver runs on, for example. The Rokus on your network should be discovered automatically, so you don't have to type in the IP address each time; just click the device you want to debug. In the command window, the up/down keys can be used to cycle through your command history. The tab key can be used to cycle through commands starting with characters already typed on the command line. You can also define 10 shortcuts for commonly used debugging commands. The Rokus' output windows have an unlimited size and can also be logged to a file. You can choose whether or not the output windows scroll automatically, and whether or not line wrapping is enabled. There are also Clear Screen and Clear Line keys.

Brilliant! Thanks, belltown! For some reason, it wasn't able to discover any of my Rokus automatically, but manually typing in the IP address worked fine. Any chance of adding support for specifying the font and size and/or sharing the source code, so we can extend the functionality ourselves?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Tue Mar 01, 2016 3:51 pm

TheEndless wrote:
Brilliant! Thanks, belltown! For some reason, it wasn't able to discover any of my Rokus automatically, but manually typing in the IP address worked fine. Any chance of adding support for specifying the font and size and/or sharing the source code, so we can extend the functionality ourselves?

Not sure why it couldn't discover your Rokus. I'm sending out the following SSDP Discovery request and listening for responses:
string ssdpRequestString = "M-SEARCH * HTTP/1.1\r\n" +
                           "HOST:239.255.255.250:1900\r\n" +
                           "MAN:\"ssdp:discover\"\r\n" +
                           "ST:roku:ecp\r\n" +
                           "MX:2\r\n" +
                           "\r\n";


The source code is embarrassingly horrible right now. It's written in C# and was my first attempt at a XAML/WPF project. I'm sure it would give anyone else headaches trying to figure it out. I will take a look at changing the font and font size, however.
https://github.com/belltown/
 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Command line Editing in Console?

Tue Mar 01, 2016 7:34 pm

belltown wrote:
Not sure why it couldn't discover your Rokus. I'm sending out the following SSDP Discovery request

You are sending/listening over UDP i hope?
Sorry, don't mean to offend but just noticed the ECP doc says "using the http protocol to 239.255.255.250 port 1900" which is... well, arguably wrong. But misleading for sure, since SSDP is not HTTP per se, it's HTTPU (http-like over UDP). Also, put space after the colon (key: value)
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Command line Editing in Console?

Tue Mar 01, 2016 8:41 pm

EnTerr wrote:
belltown wrote:
Not sure why it couldn't discover your Rokus. I'm sending out the following SSDP Discovery request

You are sending/listening over UDP i hope?
Sorry, don't mean to offend but just noticed the ECP doc says "using the http protocol to 239.255.255.250 port 1900" which is... well, arguably wrong. But misleading for sure, since SSDP is not HTTP per se, it's HTTPU (http-like over UDP). Also, put space after the colon (key: value)

Yes, definitely using UDP (a Datagram Socket as Windows calls it). I see what you mean about the Roku docs. The SSDP specs describe it as " A multicast discovery and search mechanism that uses a multicast variant of HTTP over UDP".

It works fine discovering my Rokus, and I know at least one other person whose Rokus were also discovered. So far, TheEndless is the only one who's reported a problem with the discovery mechanism. I will add a space after each colon for the headers, although it seems to work for me without them, and technically they're not required, just "preferred", whatever that means. One thing I wasn't really clear about was the "MX" header; I wasn't sure whether to leave it out, or if using it, what value to use for it. Maybe his devices are taking longer to respond to the SSDP requests, due to the number of devices, or network configuration, or something. I did notice during my own testing that there were times when one or more Rokus did not always respond to SSDP requests. I'd try again later then every device responded.
https://github.com/belltown/

Who is online

Users browsing this forum: No registered users and 3 guests