nixpulvis / oursh

Your comrade through the perilous world of UNIX.
http://nixpulvis.com/oursh/oursh
MIT License
67 stars 6 forks source link

Oursh not resetting the terminal's raw mode flag #36

Closed do-you-dare closed 5 years ago

do-you-dare commented 5 years ago

After running oursh, it seems that the terminal width or something like that is set to a mistaken value. Sorry for the lack of a better title; I can change it later.

Example:

➜  oursh git:(fix_home_path) cargo run           
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s                                                                                                             
     Running `target/debug/oursh`
oursh-0.3$ exit
➜  oursh git:(fix_home_path) cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.23s                                                                                                             
                                                                  Running `target/debug/oursh`
                                                                                              oursh-0.3$ 

All output seems to suffer from that.

I'm using zsh, if it is relevant.

nixpulvis commented 5 years ago

It's not resetting the terminal's raw mode flag. You can avoid raw mode altogether with cargo run --no-default-features --features=history,completion for now :/

nixpulvis commented 5 years ago

I'm surprised this is happening though... can you confirm you're using the latest version of termion in your build? What's the output of grep termion Cargo.lock after a build. Are you on the latest master?

do-you-dare commented 5 years ago

I'm on latest master. As for the termion version, It seems to be 1.5.1:

 "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "termion 1.5.1 (git+https://github.com/redox-os/termion)",
name = "termion"
source = "git+https://github.com/redox-os/termion#ce6b43d071cd6edfc4b366bb945b45e06c239e2c"
name = "termion"
"checksum termion 1.5.1 (git+https://github.com/redox-os/termion)" = "<none>"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
nixpulvis commented 5 years ago

Ok, I don't have this issue on my machine, but I was surprised how quickly https://gitlab.redox-os.org/redox-os/termion/merge_requests/150 my PR was merged, wouldn't surprise me if it's not 100% done (plus, I still need a way to buffer output and lock the raw buffer output for background jobs).

The relevant code is in src/repl/mod.rs.

nixpulvis commented 5 years ago

Deleted my last comment, because as it turns out it's always an issue... just my shell (fish) expects raw mode and therefor seemed fine.

nixpulvis commented 5 years ago

@dread-uo thanks for bringing this to my attention. Let me know if this fixed your issue, otherwise we can reopen this.

And, let me know if you find anything else, or have ideas of how to implement the many remaining features.