Giter VIP home page Giter VIP logo

orbitalshell / orbital-shell Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 5.0 16.5 MB

Orbital Shell is a command shell based inspired by bash and POSIX recommendations, coded in C# NET 5.0

Home Page: https://orbitalshell.github.io/Orbital-Shell/

License: MIT License

C# 98.80% Shell 1.20%
linux shell bash cli csharp interactive command-line-tool command-line-tools command-line-parser command-line-interface netstandard21 netcore31 netcore5 orbital posix-recommendations streams engine history posix ansi

orbital-shell's Issues

traditional batch of shell commands (.sh,.orbsh)

implementation is incomplete regarding to:

  • env not correctly initialized : a sub shell must be prepared to run the batch (that is the same for running any command)
  • batch args not transmitted to the batch env
  • instructional commands missing: if,else,test,...

Keyboard Shortcut Support Issue

Describe the bug
The shortcuts is not supported completely. (like Control+C)

To Reproduce

  1. ssh xxx@xxx
  2. if ssh is waiting for response, Control-C will not work,

Expected behavior
Control-C works

Desktop (please complete the following information):

  • OS: Windows 10 Pro

Hooks that may be triggered several times could lead to unexpected module behavior

Describe the bug
Hooks that may be triggered several times could lead to unexpected module behavior ๐Ÿ’ฃ๐Ÿ’ฃ๐Ÿ’ฃ๐Ÿ’ฃ : generally hooks crash and module isn't loaded. module loading chain is not canceled.

To Reproduce
load twice modules with:

> module -i {modulePath}

Expected behavior
hooks like MODULE INIT should not be triggered several times. Module should not have to handle this

up and arrows keys doesn't works on linux in clr

linux deploy (thanks to @Yobatman38) : up and down arrows doesn't works in clr (command line reader)

Expected behavior
move in command history, that should be output just after the prompt, clearing any previous input/output

Desktop:

  • OS: linux
  • Version: Linux 5.4.0.65-generic (Unbuntu SMP)

C# language scripts (.cssh)

like c# functions supported by the shell, we could run special batch of c# script.
simply share the CommandEvaluationContext, add supports for standards libs, add declaration of supplementary lib imports and runs the script in the c# script engine

$_./ doesn't works ... others special vars with single car behind _. also

was thinking of a default in variable name parser, but seems it is just a lake of variable name searching in namespaces, like if the _ namespace if never scanned by search var function.
see the code:

OrbitalShell-Kernel/Component/Shell/Variable/Variables.cs

/// <summary>
/// search in variables the path according to these precedence rules:
/// - absolute path
/// - path related to Local
/// - path related to Env
/// - path related to Global
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public bool Get(string path, out object value, bool throwException = true)
{
    var r = _dataRegistry.Get(path, out value)
    || _dataRegistry.Get(Nsp(VariableNamespace.local, path), out value)
    || _dataRegistry.Get(Nsp(VariableNamespace.global, path), out value)
    || _dataRegistry.Get(Nsp(VariableNamespace.env, path), out value);
    if (!r && throwException)
        throw new VariablePathNotFoundException(path);
    return r;
}

there is no search in:

VariableNamespace._

what is strange is that search in absolute path failed for _.{..}

to reproduce:

> echo $_./

โš ๏ธ the use of caracter '_' should be a source of councerns since it is also used as namespace separator encoding in Enums that define variables namespaces and names

The rm command does'nt works properly at all

The rm command does'nt works properly at all
stupid erros coz try to delete several times the same items + few less rights in windows terminal/any debugger (manifest should elevate privileges but seems to not be supported in .net core)

To Reproduce

> mkdir folderName
> rm folderName -r -v

๐Ÿ’ฅ ๐Ÿ”Ž the folder is not erased

if not empty:

removed drw--- Feb 19 14:33 C:/Users/franc/Documents/ORBITAL-SHELL/myrep/folder
One or more errors occurred. (Could not find a part of the path 'C:\Users\franc\Documents\ORBITAL-SHELL\myrep\folder\hello world.txt'.)

๐Ÿ’ฅ ๐Ÿ”Ž files and sub-folders deleted, but folder is not erased

Expected behavior
no error, anything deleted

context

the complemented is implemented in:

https://github.com/OrbitalShell/Orbital-Shell/blob/master/OrbitalShell-Kernel-Commands/Commands/FileSystem/FileSystemCommands.cs

groups of commands ( .. ; .. )

implements syntax in command line parser and link to existing grouping of commands in command line processor.
syntax is ( command1 args1 ; ... ; commandn argsn )

command alias should respect bash posix

command alias should respect bash posix

currently

alias {aliasName} {aliasText} 

Expected

alias {aliasExpression} 

with alias expression := aliasName = aliasText

issue

variables are substituted because they appears in a command parameter string ... it would be better if the substitution of variables is avoid in that case, thus the evaluation of parameters can be done when executing the alias text, otherwise the substitution is done twice (actual case)

background execution ( & )

add syntax:
commandName commandArgs &
and do not wait end of exec (current case) for respecting consign &

auto complete with TAB at command line reader input

auto complete with TAB at command line reader input

needs a thesaurus of words provided by the kernel and any component that contains known words classified by category. the command line parser must provides the word category

Streams redirections ( < > )

implements support of streams redirects in command line.
partially implemented. needs to be completed. related to pipeline processor (pp)

fix kernel architecture weaks (remove static classes, add dependency injection, eventually interfaces for dis-coupling and modularity)

example of need of DI: see

        /// <summary>
        /// register a kernel-hook
        /// </summary>
        /// <param name="context">command evaluation context</param>
        /// <param name="mi">hook method info</param>
        public void RegisterHook(
            CommandEvaluationContext context,
            string name,

            MethodInfo mi)
        {
            object owner = _GetInstance(mi.DeclaringType);      // TODO: having no instance, we MUST use DI to share INSTANCES
            var hs = new HookSpecification(name, owner, mi);
            _hooks.AddOrReplace(name, hs);
        }

๐Ÿ‘๏ธ https://github.com/OrbitalShell/Orbital-Shell/blob/master/OrbitalShell-Kernel/Component/Shell/Module/ModuleHookManager.cs

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.