Comments (13)
Here's what I'm thinking:
- Detect rows (currently adding this for some new features) and columns
- If columns is less than
minimumColumns
(defaults to 10), the column count will be set tomaximumColumns
(defaults to 5000 to essentially disable breaking)
Any thoughts?
from scribe.
The issue also occurs any time the application is being run from SBT, whether it's from IntelliJ or externally. Before the stack trace is printed, a few warnings are given:
[error] Nov 17, 2022 3:54:46 AM org.jline.utils.Log logr
[error] WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
Full stack trace
[error] java.lang.StringIndexOutOfBoundsException: begin 0, end -3, length 56
[error] at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4604)
[error] at java.base/java.lang.String.substring(String.java:2707)
[error] at scribe.output.TextOutput$.splitAt$extension(LogOutput.scala:32)
[error] at scribe.output.TextOutput.splitAt(LogOutput.scala:32)
[error] at scribe.format.FormatBlock$MultiLine.$anonfun$format$11(FormatBlock.scala:313)
[error] at scala.collection.immutable.List.flatMap(List.scala:293)
[error] at scribe.format.FormatBlock$MultiLine.format(FormatBlock.scala:309)
[error] at scribe.format.FormatBlocksFormatter.$anonfun$format$1(FormatBlocksFormatter.scala:8)
[error] at scala.collection.immutable.List.map(List.scala:250)
[error] at scribe.format.FormatBlocksFormatter.format(FormatBlocksFormatter.scala:8)
[error] at scribe.handler.SynchronousLogHandle$.$anonfun$log$1(SynchronousLogHandle.scala:8)
[error] at scribe.handler.SynchronousLogHandle$.$anonfun$log$1$adapted(SynchronousLogHandle.scala:7)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.handler.SynchronousLogHandle$.log(SynchronousLogHandle.scala:7)
[error] at scribe.handler.LogHandlerBuilder.log(LogHandlerBuilder.scala:14)
[error] at scribe.Logger.$anonfun$logInternal$2(Logger.scala:131)
[error] at scribe.Logger.$anonfun$logInternal$2$adapted(Logger.scala:131)
[error] at scala.collection.immutable.List.foreach(List.scala:333)
[error] at scribe.Logger.$anonfun$logInternal$1(Logger.scala:131)
[error] at scribe.Logger.$anonfun$logInternal$1$adapted(Logger.scala:130)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.logInternal(Logger.scala:130)
[error] at scribe.Logger.$anonfun$logInternal$4(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$4$adapted(Logger.scala:132)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.$anonfun$logInternal$1(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$1$adapted(Logger.scala:130)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.logInternal(Logger.scala:130)
[error] at scribe.Logger.$anonfun$logInternal$4(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$4$adapted(Logger.scala:132)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.$anonfun$logInternal$1(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$1$adapted(Logger.scala:130)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.logInternal(Logger.scala:130)
[error] at scribe.Logger.$anonfun$logInternal$4(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$4$adapted(Logger.scala:132)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.$anonfun$logInternal$1(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$1$adapted(Logger.scala:130)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.logInternal(Logger.scala:130)
[error] at scribe.Logger.$anonfun$logInternal$4(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$4$adapted(Logger.scala:132)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.$anonfun$logInternal$1(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$1$adapted(Logger.scala:130)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.logInternal(Logger.scala:130)
[error] at scribe.Logger.$anonfun$logInternal$4(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$4$adapted(Logger.scala:132)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.$anonfun$logInternal$1(Logger.scala:132)
[error] at scribe.Logger.$anonfun$logInternal$1$adapted(Logger.scala:130)
[error] at scala.Option.foreach(Option.scala:437)
[error] at scribe.Logger.logInternal(Logger.scala:130)
[error] at scribe.Logger.log(Logger.scala:119)
[error] at scribe.ScribeImpl$.$anonfun$log$extension$1(ScribeImpl.scala:9)
[error] at delay @ scribe.ScribeImpl$.log$extension(ScribeImpl.scala:9)
[error] at defer @ scribe.ScribeImpl$.log$extension(ScribeImpl.scala:13)
[error] at defer @ scribe.ScribeImpl$.log$extension(ScribeImpl.scala:13)
from scribe.
@s5bug ah, interesting. I'm actually in the process of making some changes to this logic, so the timing of this bug is very much appreciated. :) The warning is known and locally I've already removed JLine entirely in favor of tput, but it sounds like tput isn't reporting properly in certain circumstances either. What's especially strange is why it would say "1" instead of "0" or "-1". Is it consistently reporting "1"?
from scribe.
Also, would you rather, when not able to be detected, I set a default like 120 characters or do I think I just just disable alignment?
from scribe.
See: https://github.com/outr/scribe/blob/master/core/jvm/src/main/scala/scribe/Platform.scala#L13-L17
from scribe.
I am in favor of your proposed behavior! I don't know why tput is reporting 1, but it was consistent across my 3 debug runs...
from scribe.
I would prefer Scribe not pollute my home directory, instead opting for a cache directory:
.XDG_CACHE_HOME
on systems that support it, %LocalAppData%/scribe
on Windows, etc. Especially since it can recreate the file.
Also, I believe that one can remove the -c
on L109, in turn allowing for the shebang to be dropped on L95. Windows bash doesn't live at /bin/bash
, so I don't know whether that shebang would cause problems or not.
from scribe.
I've removed the -c
and shebang and it still works. Regarding the script file location, I've changed it to ~/.cache/scribe/cursor-position.sh
instead. I think that's a better option on *nix but I'm not sure how well that will go on Windows. Honestly, I suspect this won't work on Windows anyway since I doubt tput is available in general.
from scribe.
New release with these changes: https://github.com/outr/scribe/releases/tag/3.10.5
from scribe.
Please close this issue after you've had a chance to verify this works.
from scribe.
It does work!
from scribe.
As for caches, perhaps it's worth making something that looks for {XDG_CACHE_HOME}/scribe
on Linux, {CSIDL_LOCAL_APPDATA}/scribe
on Windows. Mac seems to not have an environment variable and {user.home}/Library/Caches/com.outr.scribe
is fine.
A good fallback for {XDG_CACHE_HOME}
is {user.home}
. Getting {CSIDL_LOCAL_APPDATA}
should always succeed, but I think a bit native code might have to be written to do it?
An equivalent to https://docs.rs/dirs/latest/dirs/fn.cache_dir.html might not be too hard. I don't know how to get those Windows directories on ScalaJS though.
from scribe.
If you'd be interested in testing this out I'd welcome a PR for the functionality. :)
from scribe.
Related Issues (20)
- Scala JS source maps, map to release dir? HOT 9
- No colours when run on Node.js HOT 14
- TASTy file was produced by Scala 3.2.0 HOT 7
- [Suggestion] improve JSON logging usability HOT 5
- REPL: scribe macro NPE when the scala source file is virtual HOT 4
- Include ISO8601 datetime formatters in core HOT 7
- Logstash encoding for stdout HOT 2
- Exceptions are not logged by SLF4JHelper since 3.9.0 HOT 5
- Unable to have minimumLevel=Info and only enable Trace for certain packages HOT 11
- Overriding the path for log files HOT 4
- Help: configure stdout/stderr in function of LogLevel HOT 15
- Compare perfomance with Chronicle-Logger HOT 2
- NPE when logging with SLF4J and Throwble == null HOT 4
- Different versions of scala-collection-compat pulled in transitively HOT 3
- Logger ignores `data` field HOT 3
- AsynchronousLogHandle shutdown hook HOT 3
- MDC syntax improvement HOT 7
- Standardize JSON output ? HOT 3
- Is it safe to use MDC with cats-effect? HOT 5
- Logging stderr HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scribe.