Skip to content

Commit

Permalink
Give initial PS4 value
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Aug 22, 2024
1 parent 7f57481 commit 73a97e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ impl ShellCore {
ignore_signal(Signal::SIGPIPE);
ignore_signal(Signal::SIGTSTP);

core.data.set_param("PS4", "+ ");

if unistd::isatty(0) == Ok(true) {
const V: &'static str = env!("CARGO_PKG_VERSION");
eprintln!("Rusty Bash (a.k.a. Sushi shell), version {}", V);
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ fn run_signal_check(core: &mut ShellCore) {
} //thanks: https://dev.to/talzvon/handling-unix-kill-signals-in-rust-55g6

fn read_rc_file(core: &mut ShellCore) {
if ! core.data.flags.contains("i") {
return;
}

let dir = match core.data.get_param("CARGO_MANIFEST_DIR").as_str() {
"" => core.data.get_param("HOME"),
s => s.to_string(),
Expand Down
5 changes: 5 additions & 0 deletions test/error
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
./test_script.bash
./test_script.bash
./test_script.bash
./test_script.bash
../test/test_script.bash
../test/test_script.bash
./test_script.bash
./test_script.bash
2 changes: 1 addition & 1 deletion test/lineno.sush
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sush -xv
#!../target/release/sush -xv

echo $0
echo $1
Expand Down

0 comments on commit 73a97e8

Please sign in to comment.