Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions Base/usr/share/man/man1/Applications/Terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,31 @@ $ Terminal [options]

## Description

Terminal is a terminal emulator application for Serenity.
Terminal is a terminal emulator application for Serenity. It supports multiple tabs within a single window.

It can be launched from the System Menu or the quick access icon to its right, via the `Open in Terminal` action in File Manager and on the Desktop. You can also click on the `Open` link above to launch Terminal.

### Tabs

- Open a new tab with `Ctrl+T` or via `File → New Tab`, or by clicking the `+` button in the tab bar.
- Close a tab by clicking the `×` button on it or via `File → Quit` when only one tab is open.
- The tab bar is hidden when only a single tab is open and shown automatically when more tabs are added.

### Settings

Select `File → Terminal Settings` to launch the Terminal Settings dialog and display user configurable application properties. This dialog box contains two tabs: View and Terminal.

The _View_ tab provides the most frequently sought options:

- Adjust the Terminal font (turn off `Use system default` to select a custom font.
- Adjust the Terminal font (turn off `Use system default` to select a custom font).
- Specify background opacity, i.e. the amount to which the Terminal's background is transparent, displaying what's underneath.
- Change the shape of the cursor from Block, to Underscore or to Vertical bar. You can also opt to enable or disable cursor's blink property.
- To enable or disable the display of terminal scrollbar.
- Change the shape of the cursor from Block, to Underscore or to Vertical bar. You can also opt to enable or disable the cursor's blink property.
- To enable or disable the display of the terminal scrollbar.

The _Terminal_ tab gives less frequently used options:

- To either enable System beep, or use Visual bell or disable bell mode altogether.
- To change Terminal's exit behavior
- To change Terminal's exit behavior.

Clicking on the _Apply_ button will cause the currently selected options to take effect immediately.

Expand All @@ -38,8 +46,8 @@ You can toggle Fullscreen mode by pressing F11.

- `--help`: Display help message and exit
- `--version`: Print version
- `-e`: Execute this command inside the terminal
- `-k`: Keep the terminal open after the command has finished executing
- `-e <command>`: Execute this command inside the terminal
- `-k`: Keep the terminal open after the command has finished executing (only valid with `-e`)

## Examples

Expand Down
10 changes: 5 additions & 5 deletions Userland/Applications/Browser/BrowserWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ BrowserWindow::BrowserWindow(WebView::CookieJar& cookie_jar, Vector<URL::URL> co
update_displayed_zoom_level();
};

m_tab_widget->on_middle_click = [](auto& clicked_widget) {
auto& tab = static_cast<Browser::Tab&>(clicked_widget);
tab.on_tab_close_request(tab);
};

m_tab_widget->on_tab_close_click = [](auto& clicked_widget) {
auto& tab = static_cast<Browser::Tab&>(clicked_widget);
tab.on_tab_close_request(tab);
Expand All @@ -96,6 +91,11 @@ BrowserWindow::BrowserWindow(WebView::CookieJar& cookie_jar, Vector<URL::URL> co
tab.context_menu_requested(context_menu_event.screen_position());
};

m_tab_widget->set_add_tab_button_enabled(true);
m_tab_widget->on_add_tab_button_click = [this] {
create_new_tab(Browser::g_new_tab_url, Web::HTML::ActivateTab::Yes);
};

m_window_actions.on_create_new_tab = [this] {
create_new_tab(Browser::g_new_tab_url, Web::HTML::ActivateTab::Yes);
};
Expand Down
9 changes: 5 additions & 4 deletions Userland/Applications/PixelPaint/MainWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ MainWidget::MainWidget()
}
};

m_tab_widget->on_middle_click = [&](auto& widget) {
m_tab_widget->on_tab_close_click(widget);
};

m_tab_widget->on_tab_close_click = [&](auto& widget) {
auto& image_editor = verify_cast<PixelPaint::ImageEditor>(widget);
if (image_editor.request_close()) {
Expand Down Expand Up @@ -188,6 +184,11 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
}
});

m_tab_widget->set_add_tab_button_enabled(true);
m_tab_widget->on_add_tab_button_click = [this, &window] {
m_new_image_action->activate(&window);
};

m_new_image_from_clipboard_action = GUI::Action::create(
"&New Image from Clipboard", { Mod_Ctrl | Mod_Shift, Key_V }, g_icon_bag.new_clipboard, [&](auto&) {
auto result = create_image_from_clipboard();
Expand Down
11 changes: 9 additions & 2 deletions Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector<NonnullR

setup_tabs(m_workbook->sheets());

m_tab_widget->set_add_tab_button_enabled(true);
m_tab_widget->on_add_tab_button_click = [&] { add_sheet(); };

m_new_action = GUI::Action::create("Add New Sheet", Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) {
add_sheet();
});
Expand Down Expand Up @@ -342,8 +345,9 @@ void SpreadsheetWidget::clipboard_content_did_change(ByteString const& mime_type
m_paste_action->set_enabled(!sheet->selected_cells().is_empty() && mime_type.starts_with("text/"sv));
}

void SpreadsheetWidget::setup_tabs(Vector<NonnullRefPtr<Sheet>> new_sheets)
GUI::Widget* SpreadsheetWidget::setup_tabs(Vector<NonnullRefPtr<Sheet>> new_sheets)
{
GUI::Widget* last_view = nullptr;
for (auto& sheet : new_sheets) {
auto& new_view = m_tab_widget->add_tab<SpreadsheetView>(String::from_byte_string(sheet->name()).release_value_but_fixme_should_propagate_errors(), sheet);
new_view.model()->on_cell_data_change = [&](auto& cell, auto& previous_data) {
Expand Down Expand Up @@ -439,7 +443,9 @@ void SpreadsheetWidget::setup_tabs(Vector<NonnullRefPtr<Sheet>> new_sheets)

static_cast<CellSyntaxHighlighter*>(const_cast<Syntax::Highlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(nullptr);
};
last_view = &new_view;
}
return last_view;
}

void SpreadsheetWidget::try_generate_tip_for_input_expression(StringView source, size_t cursor_offset)
Expand Down Expand Up @@ -644,7 +650,8 @@ void SpreadsheetWidget::add_sheet()

Vector<NonnullRefPtr<Sheet>> new_sheets;
new_sheets.append(m_workbook->add_sheet(name.string_view()));
setup_tabs(move(new_sheets));
if (auto* new_tab = setup_tabs(move(new_sheets)))
m_tab_widget->set_active_widget(new_tab);
}

void SpreadsheetWidget::add_sheet(NonnullRefPtr<Sheet>&& sheet)
Expand Down
2 changes: 1 addition & 1 deletion Userland/Applications/Spreadsheet/SpreadsheetWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SpreadsheetWidget final

explicit SpreadsheetWidget(GUI::Window& window, Vector<NonnullRefPtr<Sheet>>&& sheets = {}, bool should_add_sheet_if_empty = true);

void setup_tabs(Vector<NonnullRefPtr<Sheet>> new_sheets);
GUI::Widget* setup_tabs(Vector<NonnullRefPtr<Sheet>> new_sheets);

void try_generate_tip_for_input_expression(StringView source, size_t offset);

Expand Down
1 change: 1 addition & 0 deletions Userland/Applications/Terminal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ serenity_component(

set(SOURCES
main.cpp
TerminalWindow.cpp
)

serenity_app(Terminal ICON app-terminal)
Expand Down
Loading
Loading