-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-8587] mvnsh navigation #2117
Conversation
Ability to navigate on disk --- https://issues.apache.org/jira/browse/MNG-8587
@gnodet |
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/Directory.java
Outdated
Show resolved
Hide resolved
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/Directory.java
Outdated
Show resolved
Hide resolved
Applied proposed changes. And some explanations:
|
Anyone? |
processArgs.add("sh"); | ||
processArgs.add("-c"); | ||
} | ||
processArgs.add(String.join(" ", args)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add each item as new argument ... not a one arument with spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is shell -c
and it must be one argument (space separated)
...in/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java
Show resolved
Hide resolved
...in/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java
Outdated
Show resolved
Hide resolved
As in case of mvn that is in fact flow control for commands like --help and alike.
Thread executeThread = Thread.currentThread(); | ||
context.terminal.handle(Terminal.Signal.INT, signal -> executeThread.interrupt()); | ||
context.terminal.handle( | ||
Terminal.Signal.INT, signal -> Thread.currentThread().interrupt()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds weird. The current thread cannot be the Maven execution thread, unless maybe it actually reads from stdin. It should be a terminal's pump thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mvnenc command is always single threaded, and did install this handler from beginning to handle ctrl+c while inside of ConsolePrompt (ESC is back, Ctrl+C is "abort").
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnsh/ShellInvoker.java
Show resolved
Hide resolved
|
||
private void pwd(CommandInput input) { | ||
try { | ||
shellContext.writer.accept(shellContext.cwd.get().toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am inconsistent here: sometimes am using context.writer and sometimes context.logger... let's settle on one of these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command output does not go to logger, EXCEPT for:
- shell stderr
- exitCode != 0
- command wrongly invoked by user (cd with more than 1 or 0 param)
These above go to context.logger.error
Ability to navigate on disk and new commands:
!
execute shell command (executable or script)cd
change cwdpwd
print cwdhttps://issues.apache.org/jira/browse/MNG-8587