Skip to content
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

Better support for dumb terminals #131

Closed
jglick opened this issue Oct 23, 2020 · 6 comments
Closed

Better support for dumb terminals #131

jglick opened this issue Oct 23, 2020 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@jglick
Copy link
Contributor

jglick commented Oct 23, 2020

Split from #116. Emacs 26.3. M-x shell produces a quasi-shell with

$ echo $TERM
emacs

ANSI highlighting is supported, as well as simple cursor movement (so for example dynamic display from git pull works fine). mvnd’s dynamic display gets mangled, though; some attempt to move between lines is just too much:

$ mvnd -f …/jenkinsci/build-token-root-plugin clean verify
Building...
build-token-root:<unknown>:build-token-root         :org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean {execution: default-clean}jenkins-ci.tools:maven-hpi-plugin:3.15:validate {execution: default-validate  }apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:display-info {execution: display-info }enforce                                {execution: display-info}no-snapshots-in-release }codehaus.gmavenplus:gmavenplus-plugin:1.10.1:addTestSources {execution: test-in-groovy          }jvnet.localizer:maven-localizer-plugin:1.26:generate {execution: default               }apache.maven.plugins:maven-resources-plugin:3.2.0:resources {execution: default-resources }compiler-plugin:3.8.1:compile {execution: default-compile      }kohsuke:access-modifier-checker:1.16:enforce {execution: default-enforc              e}jenkins-ci.tools:maven-hpi-plugin:3.15:insert-test {execution: default-insert-test }codehaus.gmavenplus:gmavenplus-plugin:1.10.1:generateTestStubs {execution: test-in-groovy }apache.maven.plugins:maven-antrun-plugin:3.0.0:run {execution: createTempDir              }resources-plugin:3.2.0:testResources {execution: default-testResourcecompiler-plugin:3.8.1:testCompile {execution: default-testCompile}   jenkins-ci.tools:maven-hpi-plugin:3.15:test-hpl {execution: default-test-hpl                 }resolve-test-dependencies {execution: default-resolve-tescodehaus.gmavenplus:gmavenplus-plugin:1.10.1:compileTests {execution: test-in-groovy}           apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test {execution: default-test    }codehaus.mojo:animal-sniffer-maven-plugin:1.19:check {execution: check            }com.cloudbees:maven-license-plugin:1.8:process {execution: default         }org.jenkins-ci.tools:maven-hpi-plugin:3.15:hpi {execution: default-hpi }apache.maven.plugins:maven-jar-plugin:3.2.0:test-jar {execution: maybe-test-jar }com.github.spotbugs:spotbugs-maven-plugin:4.0.4:spotbugs {execution: spotbugs       }check                          {execution: spotbugs}build-token-root:<unknown>                                                                              
                          [INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO] 
[INFO] Using the SmartBuilder implementation with a thread count of 12
[INFO] Task segments : [clean, verify]
[INFO] Build maximum degree of concurrency is 12
[INFO] Total number of projects is 1
[INFO] 
[INFO] --------------< org.jenkins-ci.plugins:build-token-root >---------------
[INFO] Building Build Authorization Token Root Plugin 1.8-SNAPSHOT
[INFO] --------------------------------[ hpi ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ build-token-root ---

[INFO] --- spotbugs-maven-plugin:4.0.4:check (spotbugs) @ build-token-root ---
[INFO] BugInstance size is 0
[INFO] Error size is 0
[INFO] No errors/warnings found
[INFO] Segment walltime 21 s, segment projects service time 21 s, effective/maximum degree of concurrency 1.00/12
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.491 s (Wall Clock)
[INFO] Finished at: 2020-10-23T04:30:54-04:00
[INFO] ------------------------------------------------------------------------

(The full build log looks fine, including colorization.)

@jglick
Copy link
Contributor Author

jglick commented Oct 23, 2020

Just noticed that the fancy output is turned on even when TERM=dumb, or for that matter when stdout is not a tty, like when you pipe to some other tool. Commands using ANSI magic need to disable that automatically when appropriate.

@gnodet
Copy link
Contributor

gnodet commented Oct 26, 2020

That's right, we should change the output method when the created terminal is a dumb one.

@gnodet
Copy link
Contributor

gnodet commented Oct 29, 2020

Fwiw, mvnd runs fine in Emacs term mode M-x term.

@ppalaga
Copy link
Contributor

ppalaga commented Oct 29, 2020

Can we close this then?

@gnodet
Copy link
Contributor

gnodet commented Oct 29, 2020

Can we close this then?

No, I think we should definitely make mvnd smarter and adapt to the fact that the terminal is dumb. In the emacs M-x shell, it's not completely dumb though as it does support ANSI coloring, so we don't necessarily have to strip those. But we do need to avoid the multi-thread logging somehow.

@gnodet gnodet changed the title Dynamic console output broken in Emacs M-x shell Better support for dumb terminals Oct 29, 2020
@gnodet gnodet added the enhancement New feature or request label Oct 29, 2020
gnodet added a commit to gnodet/mvnd that referenced this issue Nov 11, 2020
@gnodet gnodet added this to the 0.0.12 milestone Nov 11, 2020
@gnodet gnodet closed this as completed Nov 11, 2020
@jglick
Copy link
Contributor Author

jglick commented Jul 25, 2024

Note that for multimodule projects I still need to pass --serial to get reasonable output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants