GithubHelp home page GithubHelp logo

aesh's People

Contributors

aslakknutsen avatar balent avatar baranowb avatar brmeyer avatar danielsoro avatar dependabot[bot] avatar gaol avatar gastaldi avatar gnodet avatar gonthim avatar hasalex avatar helio-frota avatar hokuda avatar jerr avatar jfdenise avatar johnaohara avatar koentsje avatar lincolnthree avatar metacosm avatar rhusar avatar rvansa avatar ryanemerson avatar soul2zimate avatar stalep avatar stuartwdouglas avatar sunlock avatar thescouser89 avatar tomashofman avatar tristantarrant avatar vineetreynolds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aesh's Issues

Antlr and aesh

Dear,
I would like to know if it is possible to mixt Antlr and aesh callback. Indeed Antlr seem to be powerful to parse user input while aesh is able to use input (with completion support) and output console.
Thanks for your help

Split Packages Across aesh and aesh-readline

Am I missing something or do the latest versions of aesh (2.3 according to https://mvnrepository.com/artifact/org.aesh/aesh and 1.1.7 according to https://mvnrepository.com/artifact/org.aesh/aesh-readline) not actually fix the many split-package errors described in https://issues.jboss.org/browse/AESH-458?_sscc=t ?

As things stand now I can't seem to get aesh to work on JDK11. Is it supported at all?

Also, it might be a good idea to update https://github.com/aeshell/aesh/blob/master/README.asciidoc . The code described there doesn't actually work. Instead of including deprecated code it might make sense to link to https://github.com/aeshell/aesh/blob/master/examples/src/main/java/examples/SimpleExample.java. Links to code in the git repository won't go out of date.

Support special characters

It should be possible to input and output special characters, like áéíóúÁÉÍÓÚÂÊÎÔÛãõñç

Rewrite input handling

Key operations are received as a stream of ints, the problem is when some commands start with a int that is used as a defined command. Eg escape is 27 and on posix systems all arrow keys start with 27+two other ints. Whats needed is a separate thread that parses input and must (within a specified timespan) parse which key operation thats pressed.

java.io.FileNotFoundException: /home/jboss/.aesh_aliases (No such file or directory): /home/jboss/.aesh_aliases (No such file or directory)

We have a problem here when starting jboss-cli.sh from a recent jboss-7.3.3 here and I think it is related to aesh.

Sometimes the CLI does not start and the Error message is:

java.io.FileNotFoundException: /home/jboss/.aesh_aliases (No such file or directory): /home/jboss/.aesh_aliases (No such file or directory)

This looks much like a parallelization problem. We are using ansible to set up 4 different jboss servers simultaniously during our deployment so I gues when you start all 4 cli's at the same time like so:

/opt2/jboss1/bin/jboss_cli.sh && /opt2/jboss2/bin/jboss_cli.sh && /opt2/jboss3/bin/jboss_cli.sh && /opt2/jboss4/bin/jboss_cli.sh

it sometimes happens that the first cli somehow has deleted .aesh_aliases when another cli is trying to open it.

As I think a shell should be startable at any given time this exception should be handled that more appropriate than just not letting the shell fail.

Support non-ansi terminal

Should be possible to override default config by stripping away every ansi command thats sent to the terminal.

  • an easy fix would be to to force Buffer.printAnsi(..) always return an empty char array if non-ansi terminal i set.

FileResource does not handle ~ as home

While path completion works fine, o.a.io.FileResource.read() passes the file parameter directly to FileInputStream and that cannot process the path as reference to home directory.

Redirection

JReadline should implement simple redirection support.
Fist step should be to redirect standard output to file. eg: ls > dirlist.txt

Standard error

With the implementation of pipes and redirect standard error is also needed.

issue with graphics.drawString() while trying to draw text leaning on the edge

this happen when we try just print one char:

graphics.drawString("1", width, 1);
graphics.drawString("12", width - 1, 2);
graphics.drawString("123", width - 2, 3);

1


graphics.drawString("1", width - 1, 1); // < -----
graphics.drawString("12", width - 1, 2);
graphics.drawString("123", width - 2, 3);

2


works for string with 2+ chars:

graphics.drawString(" 1", width - 1, 1); // < ----- added blank char
graphics.drawString("12", width - 1, 2);
graphics.drawString("123", width - 2, 3);

3

Command line parser

The parser must validate and store the appropriate data depending on the defined parameter/options

Pipelines

JReadline should implement simple pipeline support.
The format of a pipeline is: command [ [ | OR |&] command2 ... ]
The standard output of command is connected via a pipe to the standard output of command2..

Aesh tries to read from file when '>' appears in buffer

I am only using the readline functionality of Aesh. My code is quite simple:

import java.io.IOException
import org.jboss.aesh.console.Console
import org.jboss.aesh.console.AeshConsoleCallback
import org.jboss.aesh.console.ConsoleOperation
import org.jboss.aesh.console.Prompt
import org.jboss.aesh.console.settings.SettingsBuilder

object Repl {
  def main(args: Array[String]) {
    val console = new Console(new SettingsBuilder().create())

    console.setPrompt(new Prompt("$ "))
    console.setConsoleCallback(new AeshConsoleCallback() {
      override def execute(output: ConsoleOperation): Int = {
        if (output.getBuffer == "exit") {
          try {
            console.stop()
          } catch {
            case e: IOException => e.printStackTrace()
          }
        } else {
          new SQLParser().parse(output.getBuffer) match {
            case Some(select) => console.getShell.out().println("Successfully parsed SQL: \n" + select.sql)

            case None => console.getShell.out().println("SQL could not be parsed")
          }
        }

        return 0
      }
    })
    console.start()
  }
}

I have noticed that whenever the character '<' is typed, aesh attempts to read content from the file following the character.

I don't know how to disable this, if it's even possible.

I think by default, aesh should do NO preprocessing of input in the buffer unless explicitly told to (currently I have no idea how many other cases it will try to handle).

Multiline input support

When the user enter an incomplete command such as a quote beginning, the shell should prompt for the end of the command before actually processing the command, as done in unix shells.

ArrayIndexOutOfBoundsException

Not sure what exactly I pressed when scrolling through command history, but I got this:

[hyperfoil]$ Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.elementData(ArrayList.java:422)
	at java.util.ArrayList.get(ArrayList.java:435)
	at org.aesh.readline.history.InMemoryHistory.get(InMemoryHistory.java:89)
	at org.aesh.readline.history.InMemoryHistory.getPreviousFetch(InMemoryHistory.java:119)
	at org.aesh.readline.action.mappings.PrevHistory.accept(PrevHistory.java:37)
	at org.aesh.readline.Readline$AeshInputProcessor.parse(Readline.java:235)
	at org.aesh.readline.Readline$AeshInputProcessor.access$100(Readline.java:174)
	at org.aesh.readline.Readline.readInput(Readline.java:95)
	at org.aesh.readline.Readline.access$1000(Readline.java:57)
	at org.aesh.readline.Readline$AeshInputProcessor.lambda$start$1(Readline.java:324)
	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:118)
	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:31)
	at org.aesh.io.Decoder.write(Decoder.java:133)
	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:216)
	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:203)
	at org.aesh.readline.ReadlineConsole.accept(ReadlineConsole.java:235)
	at org.aesh.readline.ReadlineConsole.accept(ReadlineConsole.java:87)
	at org.aesh.readline.tty.terminal.TerminalConnection.init(TerminalConnection.java:153)
	at org.aesh.readline.tty.terminal.TerminalConnection.<init>(TerminalConnection.java:86)
	at org.aesh.readline.tty.terminal.TerminalConnection.<init>(TerminalConnection.java:96)
	at org.aesh.readline.ReadlineConsole.start(ReadlineConsole.java:183)
	at org.aesh.AeshConsoleRunner.start(AeshConsoleRunner.java:115)
	at io.hyperfoil.cli.HyperfoilCli.main(HyperfoilCli.java:116)

Support commands/extensions

JReadline need to provide api/support for external processes/commands to run in the foreground.
JReadline need to send user input to these commands.

Better redirect and pipeline handler

Currently the redirect and pipeline implementation is simple and insufficient. It need to support all possible functions and handle syntax error and escaped spaces.

Accept the character "-" for the values of an option

If the first character of a value is an - that don't work.
Example: foo -myvalue
But if you use a double quote and space that work.
Example: foo " -myvalue"

It would be nice if a value beginning with - and matching any option is taken as a value of the previous option.

Native generator shortcomings

The native generator has a number of shortcomings:

  • it does not navigate the full command hierarchy (e.g. sub-groups)
  • it doesn't handle custom completers and activators

Ansi Color Output?

Aesh looks like a really cool project. It even has graphics!

We're looking into commands that would print syntax-highlighted XML and JSon to the console... unless their output is being routed to a file or pipe in which case we don't want any Ansi highlight codes in the output.

How would you accomplish this with Aesh?

Is it possible to integrate Jansi (https://github.com/fusesource/jansi) with aesh? Jansi solves this problem nicely but it's not obvious how to integrate it with aesh.

Aesh does not properly validate required argument

Reproducer: https://github.com/thescouser89/aesh-reproducer
Aesh version: 2.6
Affects: https://github.com/project-ncl/bacon/issues/328

The CLI is configured to have 1 required argument and 1 optional flag (--flag) aesh CLI does not fail on missing argument if a boolean flag is specified.

Expected successful run:

java -jar <app> test helloworld --verbose
# or
java -jar <app> test helloworld

where 'test' is the command, and 'helloworld' the argument
if I run:

java -jar <app> test --verbose

I expect the CLI to fail with missing argument error. Instead, it happily moves ahead with further processing, setting the argument field to null.

Can't pass option with quotes

I'm trying to use:

CommandRuntime runtime = AeshCommandRuntimeBuilder.builder().commandRegistry(registry).build();
runtime.executeCommand(line);

But can't figure out how to pass option with this value: test=="some thing"

Tried these things already:
some command --query "name==\"some thing\"" => test==\"some thing\"
some command --query name=="some thing" => test==some thing
some command --query "name=="\""some thing"\""" => and unknown argument "some thing

Also the problem is that I already have String[] args and I need a way to concatenate them somehow first for aesh later split them again to the same things before concatenation.

alias functionality

alias should work similar to posix alias. - it should also be possible to disable it from Settings

Fileutils improvement

Fileutils need to handle:

  • filenames with spaces
  • ~/
  • windows file system (need to test this)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.