Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EnTerr
Roku Guru

Command line Editing in Console?

Working in the Roku console ("BrightScript Debugger>" prompt) is quite tedious if it has to be done for a long time. In particular i am missing the ability to recall previous commands and edit them. The only thing i know to work is Backspace (am i missing some other keys?).

Can we please have some better, basic editing of the command line? Pretty please (with Zucker on top). All i personally long for are:
  • Left/Right arrows to edit current line

  • Up/Down arrows to recall previous lines

  • ... and that's it!

Isn't there some unix library for that already? I see the name "Readline" thrown around. If - as i suspect - the issue is that it is GPL-infected, well there are alternatives - for example this https://github.com/antirez/linenoise both has a permissive license and is 20x smaller.


PS. on a side note, last century called and they want their COMMAND.COM back: http://sdkdocs.roku.com/pages/diffpages ... Id=3737101 - this side of the millennium, Windows shell is CMD.EXE. Apology for the nit-picking but as a recovering MCSE this rubs me the wrong way
0 Kudos
73 REPLIES 73
RokuMarkn
Visitor

Re: Command line Editing in Console?

If you're already using Linux, you can use rlwrap to add readline features to your telnet client.

--Mark
0 Kudos
EnTerr
Roku Guru

Re: Command line Editing in Console?

"RokuMarkn" wrote:
If you're already using Linux, you can use rlwrap to add readline features to your telnet client.

Nope, not using Linux. Using OSX and WIndows in turns. Sounds like a nice little utility for those that have it. For me though, to install on OSX i'll have to re-visit Homebrew vs MacPorts vs Fink debates to figure to whose mercy should i surrender my Mac. And no clue what will it take on Windows.

I am however trying to use Roku and the pain is palpable. Can i entice you to disable "rlwrap" on your linux for couple of weeks?
And I bet that before that term is over, in an upcoming branch of the firmware the console line will miraculously grow editing features. Smiley LOL

That "minimal, zero-config, BSD licensed, readline replacement used in Redis, MongoDB, and Android [shells]" i ran into though?
One file, thousand (commented) lines, no pain.
0 Kudos
Komag
Roku Guru

Re: Command line Editing in Console?

I use Eclipse just for the console, which gives me those nice features, plus I can set it to save thousands of lines back, as much as I want.
0 Kudos
NewManLiving
Visitor

Re: Command line Editing in Console?

Even with its shortcomings eclipse is the best. Can even open multiple telnets right next to the debug console for your scene graph threads. Would be nice to see a visual component plugin to design and generate scene graph components and XML. But that's wishful thinking
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
EnTerr
Roku Guru

Re: Command line Editing in Console?

Installing Roku Plugin's version of Eclipse just for the console would be no better than running a Linux virtual machine for the "rlwrap" command alone. The roku-plugin seems more of a cruel practical joke (remember the Co's April Fool's jokes?), in stark contrast with Roku platform self-sufficiency (think Lotus) which i like.

Practically speaking though, it makes no sense fixing if i am the only crank unhappy with the lack of line editing in console.
Are there other developers that wish the ability was there - simple line editing while telnet-ed to 8085/8080 ? Raise your hand...
0 Kudos
NewManLiving
Visitor

Re: Command line Editing in Console?

The subject ( your question) was about the console so the answers are related to the console. I don't consider the plugin a practical joke. Eclipse is a fully integrated development environment when used with the plugin. This has met my needs as a 2D programmer with thousands of lines of code in dozens of projects all neatly organized and accessible in their various outliners and managers. The ability to use other plugins for XML, JSON, along with a language specific editor including help/suggestions add to its value. Then there is the packager, exporter , key generation etc. the ability to open multiple telnets to observe threads. The object outliner, the ability to associate files in the project with other software such as image editors, video editors etc... I have always used an IDE. Visual Studio being one of the first. Could not imagine how I would be able to organize let alone upload the infinite amount of times by switching back and forth between software just to perform a specific step in the development process which repeats hundreds of times during a normal work day, without using an IDE. make changes then select file-export and it is side loaded in a couple of seconds. Or the mistake is presented right there in front of you, click on it to be taken to the line in the file, fix it and your good to go.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
RokuJoel
Binge Watcher

Re: Command line Editing in Console?

Sure, I wish we had at least a history buffer in the console. The Eclipse plugin, if you can get it working, is a major improvement in many ways though:

Click on an error in the console and the source file/line will appear in the editor
Source directory file-contents search
Syntax Highlighting
one-click build-to-the-same device


- Joel
0 Kudos
belltown
Roku Guru

Re: Command line Editing in Console?

I agree with EnTerr. I've tried installing Eclipse on 3 prior occasions and gave up on it for various reasons. Anything Java'y has always given me headaches. I'd rather use Notepad++ or Visual Studio or Atom or anything else, particularly since the features you need from an IDE for BrightScript development don't exactly need to be "full-fledged", at least for the stuff I work on.

It can't be that hard to write a Windows console program that interfaces with the Roku Debugger, and provides better command-line handling than a Telnet client.

I have a few free days while I'm off work sick. I think I'll get to work on it.

- Command history
- Line-based input instead of character-by-character input
- Arrow keys: up, down, left, right
- Maybe session logging and support for utf-8 output as well?
0 Kudos
EnTerr
Roku Guru

Re: Command line Editing in Console?

"RokuJoel" wrote:
... The Eclipse plugin, if you can get it working, is a major improvement in many ways though:
  • Click on an error in the console and the source file/line will appear in the editor

  • Source directory file-contents search

  • Syntax Highlighting

  • one-click build-to-the-same device

Right, "if you can get it working" ;). 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).

The features you enumerated above are essential indeed! But i got them working already with a much simpler and more reliable setup. In OSX, it was some config tweaks to TextWrangler (a free programmer's editor) and you got .BRS syntax highlighting, hot-key to package&deploy to device, naturally it has already the multi-file search, un/comment, text shift left/right, bracket-matching, support for JSON/XML/many more... and i think i got the jump-to-error-line too.

I was thinking of writing a "guide to lightweight Roku development" post after some fruitful PM exchange with squirreltown (what happened to that guy?) that made me realize not everybody feels comfortable keeping an open Terminal window. It actually made me improve my process by integrating the build script in the editor. (Anybody think they need specific instructions on how to do it? There is not much to it.) And that was umm... almost two years ago :shock:. Heck, i haven't even written you (RokuJoel) yet a personal "thank you" note for your above-and-beyond assistance publishing a channel before the end of 2015!
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.