mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 05:35:52 +03:00
Shell: Load a different rc file when in POSIX mode
This commit is contained in:
parent
832478ad0c
commit
d997b794fa
Notes:
sideshowbarker
2024-07-18 03:35:30 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/d997b794fa Pull-request: https://github.com/SerenityOS/serenity/pull/17953
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:
|
||||
constexpr static auto local_init_file_path = "~/.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; }
|
||||
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);
|
||||
}
|
||||
};
|
||||
run_rc_file(Shell::Shell::global_init_file_path);
|
||||
run_rc_file(Shell::Shell::local_init_file_path);
|
||||
if (posix_mode) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user