1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibLine+Shell: Allow some programs to modify the current termios

This setting can be controlled by setting the
PROGRAMS_ALLOWED_TO_MODIFY_DEFAULT_TERMIOS _local_ shell variable to a
list containing such programs.
This commit is contained in:
Ali Mohammad Pur 2021-05-24 16:50:16 +04:30 committed by Ali Mohammad Pur
parent e318f12263
commit b2ef18d538
4 changed files with 50 additions and 11 deletions

View file

@ -108,9 +108,9 @@ public:
static bool has_history_event(StringView);
RefPtr<AST::Value> get_argument(size_t);
RefPtr<AST::Value> lookup_local_variable(const String&);
String local_variable_or(const String&, const String&);
RefPtr<AST::Value> get_argument(size_t) const;
RefPtr<AST::Value> lookup_local_variable(const String&) const;
String local_variable_or(const String&, const String&) const;
void set_local_variable(const String&, RefPtr<AST::Value>, bool only_in_current_frame = false);
void unset_local_variable(const String&, bool only_in_current_frame = false);
@ -278,6 +278,8 @@ private:
void timer_event(Core::TimerEvent&) override;
bool is_allowed_to_modify_termios(const AST::Command&) const;
// FIXME: Port to Core::Property
void save_to(JsonObject&);
void bring_cursor_to_beginning_of_a_line() const;
@ -288,6 +290,10 @@ private:
void stop_all_jobs();
const Job* m_current_job { nullptr };
LocalFrame* find_frame_containing_local_variable(const String& name);
const LocalFrame* find_frame_containing_local_variable(const String& name) const
{
return const_cast<Shell*>(this)->find_frame_containing_local_variable(name);
}
void run_tail(RefPtr<Job>);
void run_tail(const AST::Command&, const AST::NodeWithAction&, int head_exit_code);