Comments (8)
Thanks for reporting this. I'll try to look into it when I have some time.
from highline.
No problem. If you have a sense of what type of bug this or maybe have a chance to confirm it is a real issue, is be happy to dig into the code a bit.
On Oct 30, 2013, at 19:55, James Edward Gray II [email protected] wrote:
Thanks for reporting this. I'll try to look into it when I have some time.
—
Reply to this email directly or view it on GitHub.
from highline.
I couldn't reproduce the crash. But in a macosx 10.9.4 and bash 4.3 Ctrl-Z in the middle of the input has unpredictable consequences on what #ask returns. Need futher investigation.
from highline.
Just taking note of this gist. Perhaps relevant.
https://gist.github.com/zdennis/3a0b685047ac086725b0
from highline.
@abinoam, thanks for looping me in here. This may very well be related. When you say:
Ctrl-Z in the middle of the input has unpredictable consequences on what #ask returns
Can you describe what you're seeing? Is it that one or more characters may be often be missing?
from highline.
Hi @zdennis
I have tried again with HighLine 1.7.1
A simple #ask as in:
#!/usr/bin/env ruby
require 'highline/import'
anything = ask("Anything? ")
puts "You told #{anything}"
If you type something, then CTRL-Z, do something, and then fg
, then you type another thing and then type enter.
HighLine just "drop" the first 'typing' and then shows you the last one (the one that you typed after the fg).
Well, but there's the "readline" mode, the noecho mode and etc. that I didn't tested.
So, IMHO, we shouldn't put too much (I mean any) effort in fixing this now.
HighLine will soon be under a major refactor.
So, with a cleaner code base I think it would be easy for you to hunt this bug (in case it persists).
from highline.
I've just tested for this behavior again with Ruby 3.2 and ubuntu 22.04.
The problem happens with "pure" gets
Try
ruby -e "p gets"
First type "first"
Then hit ctrl-Z
Then type "second" and hit <enter>
The returned string will be only "second"
I think suspending the process is flushing the input buffer.
If it affects Kernel#gets
it's probably the intended behavior to flush the input buffer when suspending, but I'm not sure.
from highline.
I've just tried with bash and the behavior is the same
#!/bin/bash
printf "Type: "
read astring
echo $astring
I'm closing this as a "non bug" meanwhile, but feel free to comment or reopen it @mickeyreiss if you want to discuss it any further.
Sorry for taking so long to answer this issue. I'm taking some time now to clean up them all these days.
from highline.
Related Issues (20)
- Proc validation displays ruby object on invalid HOT 8
- Incosistent behavior when ask with a validator and readline=true HOT 9
- undefined method 'default_instance' HOT 3
- Default Highline Example on GithubGives Error HOT 5
- HighLine Terminal::IOConsole#restore_mode does not work with StringIO HOT 3
- System extensions depend on now-internalized JRuby dependencies HOT 14
- consider exposing Readline.completion_proc via HighLine::Question#selection HOT 3
- default value has to be a string HOT 14
- Ctrl-C improperly handled when q.echo = false HOT 6
- Issues with echo: false and not on TTY HOT 7
- Can't get terminal_size HOT 11
- echo=false or echo='*' requires extra character after enter on Windows HOT 6
- Possible to accept multiple selections with `.in` and `.default`? HOT 5
- test failing when ruby is built against libedit instead of readline HOT 3
- Have to set convert type in order for `.in` to work with array
- 2.1.0 was released, but tag is missing in repository HOT 2
- Make Highline Ruby 3.3 and reline compatible HOT 1
- Update tests for Reline (as the substitute of Readline)
- Add `abbrev` to gemspec HOT 2
- `ask()` causes `Readline`-related error on Ruby 3.3 HOT 5
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 highline.