mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 14:07:43 +00:00
Shell: Load a different rc file when in POSIX mode
This commit is contained in:
parent
832478ad0c
commit
d997b794fa
3 changed files with 48 additions and 2 deletions
39
Base/etc/posixshrc
Normal file
39
Base/etc/posixshrc
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#!sh
|
||||||
|
|
||||||
|
alias fm=FileManager
|
||||||
|
alias mag=Magnifier
|
||||||
|
alias sh=Shell
|
||||||
|
alias tb=Taskbar
|
||||||
|
alias te=TextEditor
|
||||||
|
alias he=HexEditor
|
||||||
|
alias pp=PixelPaint
|
||||||
|
alias iv=ImageViewer
|
||||||
|
alias pi=Piano
|
||||||
|
alias calc=Calculator
|
||||||
|
alias calendar=Calendar
|
||||||
|
alias ins=Inspector
|
||||||
|
alias sp=SoundPlayer
|
||||||
|
alias help=Help
|
||||||
|
alias br=Browser
|
||||||
|
alias hs=HackStudio
|
||||||
|
alias sdb=Debugger
|
||||||
|
alias sm=SystemMonitor
|
||||||
|
alias pv=Profiler
|
||||||
|
alias ws=WebServer
|
||||||
|
alias ue=UserspaceEmulator
|
||||||
|
alias fe=FontEditor
|
||||||
|
alias ss=Spreadsheet
|
||||||
|
alias vp=VideoPlayer
|
||||||
|
|
||||||
|
alias ll='ls -l'
|
||||||
|
|
||||||
|
if [ "$(id -u)" = "0" ]; then
|
||||||
|
prompt_color=31
|
||||||
|
else
|
||||||
|
prompt_color=32
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PROMPT="\\X\\u@\\h:\\w\\a\\e[$prompt_color;1m\\h\\e[0m:\\e[34;1m\\w\\e[0m \\p "
|
||||||
|
export TMPDIR=/tmp
|
||||||
|
|
||||||
|
PROGRAMS_ALLOWED_TO_MODIFY_DEFAULT_TERMIOS="stty"
|
|
@ -92,6 +92,8 @@ class Shell : public Core::Object {
|
||||||
public:
|
public:
|
||||||
constexpr static auto local_init_file_path = "~/.shellrc";
|
constexpr static auto local_init_file_path = "~/.shellrc";
|
||||||
constexpr static auto global_init_file_path = "/etc/shellrc";
|
constexpr static auto global_init_file_path = "/etc/shellrc";
|
||||||
|
constexpr static auto local_posix_init_file_path = "~/.posixshrc";
|
||||||
|
constexpr static auto global_posix_init_file_path = "/etc/posixshrc";
|
||||||
|
|
||||||
bool should_format_live() const { return m_should_format_live; }
|
bool should_format_live() const { return m_should_format_live; }
|
||||||
void set_live_formatting(bool value) { m_should_format_live = value; }
|
void set_live_formatting(bool value) { m_should_format_live = value; }
|
||||||
|
|
|
@ -232,8 +232,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
shell->run_file(file_path, false);
|
shell->run_file(file_path, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
run_rc_file(Shell::Shell::global_init_file_path);
|
if (posix_mode) {
|
||||||
run_rc_file(Shell::Shell::local_init_file_path);
|
run_rc_file(Shell::Shell::global_posix_init_file_path);
|
||||||
|
run_rc_file(Shell::Shell::local_posix_init_file_path);
|
||||||
|
} else {
|
||||||
|
run_rc_file(Shell::Shell::global_init_file_path);
|
||||||
|
run_rc_file(Shell::Shell::local_init_file_path);
|
||||||
|
}
|
||||||
shell->cache_path();
|
shell->cache_path();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue