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

Enabling colors on dumb terminal causes error #328

Closed
bdw429s opened this issue Nov 13, 2018 · 3 comments
Closed

Enabling colors on dumb terminal causes error #328

bdw429s opened this issue Nov 13, 2018 · 3 comments

Comments

@bdw429s
Copy link
Contributor

bdw429s commented Nov 13, 2018

I'm using the java property org.jline.terminal.jna=false to force a dumb terminal while doing some testing on Windows. I tried to get colors back by adding org.jline.terminal.dumb.color=true. While this succeeds in getting me 8 colors it generates an error in the console while JLine starts up. The message is a "warning" level message, but I don't have any logging enabled for JLine.

Nov 13, 2018 11:34:00 AM org.jline.utils.Log logr
WARNING: Unable to retrieve infocmp for type dumb-color
java.io.IOException: Cannot run program "infocmp": CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at org.jline.utils.InfoCmp.getInfoCmp(InfoCmp.java:547)
        at org.jline.terminal.impl.AbstractTerminal.parseInfoCmp(AbstractTerminal.java:187)
        at org.jline.terminal.impl.DumbTerminal.<init>(DumbTerminal.java:88)
        at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:404)
        at org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:262)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:55)
        at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:852)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:797)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1718)
        at system.util.readerfactory_cfc$cf.udfCall(/commandbox/system/util/ReaderFactory.cfc:84)
		... 
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 88 more
@gnodet
Copy link
Member

gnodet commented Nov 13, 2018

There's a missing dumb-color.caps here: https://github.com/jline/jline3/tree/master/terminal/src/main/resources/org/jline/utils

It should contain something like the following (untested):

#      Reconstructed via infocmp from file: /usr/share/terminfo/64/dumb
dumb|80-column dumb tty with 256 colors,
        am,
        colors#256, cols#80, 
        bel=^G, cr=^M, cud1=^J, ind=^J,

@bdw429s
Copy link
Contributor Author

bdw429s commented Nov 15, 2018

@gnodet Thanks for the reply. I can try sending this as a pull, but I'm not sure how to fully test it to see if it works.

@gnodet gnodet closed this as completed in fa5964f Nov 19, 2018
snuyanzin pushed a commit to snuyanzin/jline3 that referenced this issue Nov 20, 2018
@bjab
Copy link

bjab commented Aug 19, 2019

Hi
I've provided pull-request with proper fix for dumb-color capabilities

mattirn added a commit that referenced this issue Sep 3, 2019
Properly register dumb-color terminal caps file, fixes #328
@bdw429s bdw429s changed the title Enabling colors on dumb terminal cuases error Enabling colors on dumb terminal causes error Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants