mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:57:44 +00:00
LibVT: Implement Bracketed Paste Mode
This mode allow us to escape any data that was not directly typed by the user. `vim` currently uses this. If we implement it in the shell, we could prevent newlines from being injected into the shell by pasting text or dragging files into it (see #7276).
This commit is contained in:
parent
ee24f2eb2d
commit
708f835477
4 changed files with 53 additions and 12 deletions
|
@ -157,6 +157,11 @@ public:
|
|||
Attribute attribute_at(const Position&) const;
|
||||
#endif
|
||||
|
||||
bool needs_bracketed_paste() const
|
||||
{
|
||||
return m_needs_bracketed_paste;
|
||||
};
|
||||
|
||||
protected:
|
||||
// ^EscapeSequenceExecutor
|
||||
virtual void emit_code_point(u32) override;
|
||||
|
@ -336,6 +341,8 @@ protected:
|
|||
CursorStyle m_cursor_style { BlinkingBlock };
|
||||
CursorStyle m_saved_cursor_style { BlinkingBlock };
|
||||
|
||||
bool m_needs_bracketed_paste { false };
|
||||
|
||||
Attribute m_current_attribute;
|
||||
Attribute m_saved_attribute;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue