Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Shell Component with History Function

DZone's Guide to

Shell Component with History Function

· Java Zone
Free Resource

Learn how our document data model can map directly to how you program your app, and native database features like secondary indexes, geospatial and text search give you full access to your data. Brought to you in partnership with MongoDB.

Thanks to the contribution from [francescoaru], the Shell component now has a history function:

Shell with History

Shell with History

This means (if enabled), the Shell component remembers the last few commands. Entering any non-alpha/numeric character (e.g. TAB, CURSOR-UP/DOWN/LEFT/RIGHT, etc) will show the previous command, and you can iterate trough the list. Press Enter and it gets executed. This is especially useful if you are using a terminal program like putty without history: E.g. pressing TAB will show the previous command:

Tab to show previous command

Tab to show earlier command

Then press TAB again, or simply ENTER to execute the command. You can use the cursor up/down/left/right keys to go forward and backward in the list of history, then press ENTER to execute the command.

There is one ‘not so perfect thing': if pressing cursor-up and then cursor-down, it will show the command again. But I hope this is not a big deal, otherwise any contributions to improve this are welcome :-)

The updated sources are on GitHub, so anyone using Git can use the new feature right away. Updated *.PEupd files with other added features will be released later this month on SourceForge.

Happy Historing :-)

 

Discover when your data grows or your application performance demands increase, MongoDB Atlas allows you to scale out your deployment with an automated sharding process that ensures zero application downtime. Brought to you in partnership with MongoDB.

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}