Coder Social home page Coder Social logo

Input not shown when interactive about pforth HOT 4 CLOSED

philburk avatar philburk commented on September 28, 2024
Input not shown when interactive

from pforth.

Comments (4)

jpellegrini avatar jpellegrini commented on September 28, 2024

Hello; is this the same as issue #87 (no echo from user input)?
If so, maybe you could try PR #110 -- suggested by @philburk -- which is a one-liner.

  • I was also using musl. With libc, it works fine, so it is likely the exact same problem.

from pforth.

ithuriel-github avatar ithuriel-github commented on September 28, 2024

This did solve the problem. Thank you.

from pforth.

philburk avatar philburk commented on September 28, 2024

@ithuriel-github - What happens if you remove the code related to tcsetattr()?
Maybe we don't need both techniques.

from pforth.

jpellegrini avatar jpellegrini commented on September 28, 2024

Hello,
Yes, it seems that calling tcsetattr is still necessary:

Calling tcsetattr:

# pforth
PForth V28-BE/32, built Mar 31 2022 16:07:57
pForth loading dictionary from file /usr/share/pforth/pforth.dic
     File format version is 10 
     Name space size = 120000 
     Code space size = 300000 
     Entry Point     = 0 
     Cell Size       = 4 
     Big Endian Dictionary

10    ok
Stack<10> 10 
20    ok
Stack<10> 10 20 
+    ok
Stack<10> 30    <== ends smoothly after ^D

If I supress the call to tcsetattr:

# pforth
PForth V28-BE/32, built Mar 31 2022 16:07:57
pForth loading dictionary from file /usr/share/pforth/pforth.dic
     File format version is 10 
     Name space size = 120000 
     Code space size = 300000 
     Entry Point     = 0 
     Cell Size       = 4 
     Big Endian Dictionary

10
10    ok
Stack<10> 10 
20
20    ok
Stack<10> 10 20 
+
+    ok
Stack<10> 30      <=== ^D here; it starts an infinite loop:
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������    ok
Stack<10> 30 
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������    ok
Stack<10> 30 
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������    ok
Stack<10> 30 

I've made an adjustment to the PR indenting the call to setvbuf and checking if it returns error. Is this ok?

from pforth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.