nixpulvis / oursh

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

Panick at exit with Ctrl-D #34

Closed do-you-dare closed 6 years ago

do-you-dare commented 6 years ago

Hello! I've downloaded the repository, and run cargo run. The error:

➜  oursh git:(master) cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s                                                                                                             
     Running `target/debug/oursh`
oursh-0.3$ exit
thread 'main' panicked at 'error cannot find history: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5

I tried manually creating a ~/.oursh_history file, but the error persists.

System info: OS: Fedora 28 rustc version: 1.31.0-nightly

nixpulvis commented 6 years ago

Well this is embarrassing. I forgot I just hacked in my system path lolol. You could be able to fix this pretty easily by replacing /home/nixpulvis with $HOME using std::env.

https://github.com/nixpulvis/oursh/blob/master/src/repl/history.rs#L71 https://github.com/nixpulvis/oursh/blob/master/src/repl/history.rs#L101

nixpulvis commented 6 years ago

@dread-uo also, you could probably avoid this error with cargo run --no-default-features for now.