Comments (6)
This might not be possible. I can't seem to find ways to either
- stop the terminal from autowrapping my lines
- ask the terminal its width in a consistent manner
- ask the terminal to tell me when it added a newline
There may be a way and it's probably worth leaving this bug open, but not necessarily as a 1.0 milestone. My experimentation with other dynamic CLIs is they suffer a similar fate.
from kotter.
Actually, the "$COLUMNS" variable in Linux seems to work. With seeing if this is standard-enough behavior that we can use it consistently.
from kotter.
It's still quite tricky to get the width. It's a shame either jline doesn't support this OR it does but I can't find it. (jline's terminal.getSize() doesn't update dynamically as you resize the window)
See also: https://stackoverflow.com/questions/1286461/can-i-find-the-console-width-with-java/18883172#18883172
from kotter.
Leaving the bug open because we still don't handle dynamic window resizing, and I'd like to think that's possible someday. But for now, at least we take initial window size into account, which is better than nothing, so I'm going to remove the 1.0 milestone from this bug.
from kotter.
I'm going to close this as dynamic window resizing just doesn't seem like something that consoles are good at.
from kotter.
Now that I have a bunch of K/N code, I'm actually going to reopen this and check one more time to make sure.
Really, what I need is an event that the column changed (or maybe I can poll this every frame).
I'm pretty sure I tried polling when using Jline, but I should try again now that I've got K/N solutions.
from kotter.
Related Issues (20)
- Virtual terminal: Fix underline showing on newline
- Fix busted unicode (emoji? chinese characters?) support HOT 4
- Document advanced input() cases HOT 1
- A simple game using Kotter HOT 6
- Pressing ESC followed by another key in quick succession can cause a thread lock
- Add support for NUMPAD keys HOT 1
- Add support for OSC hyperlinks HOT 4
- Timing issues with aside sections HOT 8
- `text` inside a `bordered` call is dropping the last line HOT 1
- Add "transform" callback to input() method HOT 1
- Add docs for how to test your project using Kotter HOT 2
- Investigate why `input(); textLine()` ends up with a CLEAR_INVERT command on the next line
- Consider opening up `link(uri, block)`
- Can't use Kotter without virtual terminal HOT 18
- Kotter is missing my native target
- Windows flickers if the content being redrawn is larger than the entire screen HOT 2
- K/N repaints duplicate lines if any particular line is too long horizontally HOT 2
- Add a test for Terminal#width HOT 1
- Windows + Kotlin/Native: Repaint issues reported (on legacy OS versions?) HOT 2
- K/N: Arithmetic Exception HOT 13
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 kotter.