Terminal Preview

The Terminal environment is particularly useful for:

  1. Command-line focused tasks and operations
  2. Server administration and system configuration
  3. Text-based programming and debugging
  4. Resource-efficient remote access when GUI is not needed

Access the Terminal

  1. If the instructor recommends using the terminal environment by default for the Lab, you’ll see the terminal environment when you start it.
  2. You can create additional terminal sessions by clicking the + button at the top of the interface.

Environment Features

The Terminal Interface provides several key features:

  1. Multiple Terminal Sessions:

    • Create new sessions using the + button
    • Switch between sessions using tabs
    • Close sessions individually as needed
  2. Full Ubuntu Environment:

    • Based on Ubuntu 22.04 LTS
    • Access to standard Ubuntu repositories
    • Support for common command-line tools and utilities
  3. Text-Based Tools:

    • Vim/Nano text editors
    • Command-line compilers and interpreters
    • Package management via apt
    • Git for version control

TTYD Features

The Terminal Interface is powered by TTYD (Terminal Over HTTP) and provides several advanced features:

Using tmux Commands:

# Create splits
tmux split-window -h     # Split vertically
tmux split-window -v     # Split horizontally
tmux split-window -hf    # Full-height vertical split
tmux split-window -vf    # Full-width horizontal split

# Navigate between panes
tmux select-pane -L      # Move to left pane
tmux select-pane -R      # Move to right pane
tmux select-pane -U      # Move to upper pane
tmux select-pane -D      # Move to lower pane

# Resize panes
tmux resize-pane -L 10   # Resize 10 cells to the left
tmux resize-pane -R 10   # Resize 10 cells to the right
tmux resize-pane -U 5    # Resize 5 cells up
tmux resize-pane -D 5    # Resize 5 cells down

# Additional operations
tmux kill-pane          # Close current pane
tmux select-layout tiled # Balance pane sizes

Scrolling in tmux

To view the scrollback buffer in tmux, follow these steps:

  1. Enter Copy Mode: Use the following key combination to enter copy mode:

    Ctrl + b [
    
    • Ctrl + b is the default tmux prefix (use your custom prefix if changed).
    • [ activates tmux’s copy mode, allowing you to scroll through the buffer.
  2. Navigate in Copy Mode:

    • Scroll one line at a time: Use the Up Arrow or Down Arrow keys.
    • Scroll one page at a time: Press Page Up or Page Down.
    • Jump to the top of the buffer: Press g.
    • Jump to the bottom: Press G.
  3. Exit Copy Mode: Press q to exit copy mode and return to the live terminal output.

  4. Enable Mouse Scrolling (Optional): If you prefer using the mouse to scroll:

    • Add this line to your ~/.tmux.conf file:
      set -g mouse on
      
    • Reload your tmux configuration:
      tmux source-file ~/.tmux.conf
      
      With mouse mode enabled, you can scroll through the buffer using your mouse wheel.

Usage Scenarios

Frequently Asked Questions

Was this page helpful?