Skip to content

Latest commit

 

History

History
406 lines (302 loc) · 9.35 KB

File metadata and controls

406 lines (302 loc) · 9.35 KB

Profile System Guide

NeoTerm's profile system allows you to create multiple terminal configurations with different settings, perfect for separating work environments, projects, or use cases.

What is a Profile?

A profile is a saved collection of terminal settings including:

  • Color Scheme - Specific theme for this profile (optional)
  • Font - Specific font for this profile (optional)
  • Shell Path - Which shell to use (bash, zsh, fish, etc.)
  • Initial Command - Commands to run automatically on startup
  • Extra Keys - Enable/disable extra keys row
  • Word-based IME - Input method configuration
  • Bell Settings - Enable/disable terminal bell
  • Vibration - Enable/disable vibration on bell
  • Special Key Bindings - Volume keys behavior

Creating a Profile

Step 1: Open Profile Manager

  1. Open NeoTerm
  2. Menu (⋮) → Settings → Profile Manager
  3. Tap "Create New Profile" or "+"

Step 2: Configure Profile

Profile Name (required):

  • Give your profile a descriptive name
  • Examples: "Work", "Personal", "Server Admin", "Python Dev"

Color Scheme (optional):

  • Select from 115 available schemes
  • Leave empty to use global color scheme
  • When set: overrides global for this profile

Font (optional):

  • Select from 28 available fonts
  • Leave empty to use global font
  • When set: overrides global for this profile

Shell Path:

  • Default: /data/data/io.neoterm/files/usr/bin/bash
  • Other options: /bin/sh, /usr/bin/zsh, /usr/bin/fish
  • Custom: Any valid shell path

Initial Command:

  • Commands to run when session starts
  • Examples:
    • cd ~/projects && ls
    • source ~/.profile && clear
    • tmux attach || tmux

Extra Keys:

  • ☑ Enable: Show extra keys row (ESC, TAB, CTRL, etc.)
  • ☐ Disable: Hide extra keys row

Word-based IME:

  • ☑ Enable: Better for some keyboards and languages
  • ☐ Disable: Standard input method (default)

Bell & Vibration:

  • Terminal bell enable/disable
  • Vibration on bell enable/disable

Step 3: Save Profile

Tap "Save" to create the profile.

Using Profiles

Create New Session with Profile

Method 1: From Tab Switcher

  1. Tap tab switcher button
  2. Tap "+" or Menu → New Session with Profile
  3. Select profile from list
  4. New session opens with profile settings

Method 2: From Menu

  1. Menu (⋮) → New Session with Profile
  2. Select profile
  3. Session opens immediately

Method 3: App Shortcut (Android 7.1+)

  • Long-press NeoTerm icon on home screen
  • Select profile shortcut
  • New session opens with that profile

Session Without Profile

Menu → New Session creates a session without profile, using global settings.

Profile Behavior

Settings Priority

Session WITH Profile:

Profile Settings → Override → Global Settings
  • If profile has color scheme: uses profile color scheme
  • If profile has no color scheme: uses global color scheme
  • If profile has font: uses profile font
  • If profile has no font: uses global font
  • Other settings always come from profile

Session WITHOUT Profile:

Global Settings → Applied Directly
  • Uses current global color scheme
  • Uses current global font
  • Changes to global settings apply immediately

Real-World Example

Scenario: You have:

  • Global color scheme: Nord
  • Global font: JetBrains Mono 14pt
  • Profile "Work" with: Gruvbox color, no font set
  • Profile "Python" with: Dracula color, Fira Code font

Results:

  1. New Session (no profile):

    • Color: Nord (global)
    • Font: JetBrains Mono 14pt (global)
    • Changes with global settings
  2. Work Profile Session:

    • Color: Gruvbox (profile)
    • Font: JetBrains Mono 14pt (global, profile has no font)
    • Color never changes, font changes with global
  3. Python Profile Session:

    • Color: Dracula (profile)
    • Font: Fira Code (profile)
    • Never changes, fully isolated

Managing Profiles

Edit Profile

  1. Menu → Settings → Profile Manager
  2. Tap profile to edit
  3. Modify settings
  4. Save changes
  5. Note: Changes apply to NEW sessions only, not existing sessions

Delete Profile

  1. Menu → Settings → Profile Manager
  2. Long-press profile
  3. Select "Delete"
  4. Confirm deletion
  5. Note: Existing sessions with this profile continue working but are no longer associated with the profile

Duplicate Profile

  1. Menu → Settings → Profile Manager
  2. Long-press profile
  3. Select "Duplicate"
  4. Modify duplicate as needed
  5. Save

Profile Configuration Files

File Location

Profiles are stored as NeoLang files (.nl) in:

~/.config/neoterm/profiles/

File Format Example

profile {
  meta-name: "shell-profile"
  profile-name: "Work"

  login-shell: "/data/data/io.neoterm/files/usr/bin/bash"
  initial-command: "cd ~/work && ls"

  profile-font: "JetBrains-Mono"
  profile-color-scheme: "GruvboxDark"

  enable-bell: true
  enable-vibrate: false
  enable-extra-keys: true
  enable-word-based-ime: false
  enable-special-volume-keys: false
  enable-back-key-to-escape: true
}

Manual Profile Creation

Advanced users can create profiles manually:

  1. Create .nl file in ~/.config/neoterm/profiles/
  2. Use NeoLang syntax (see example above)
  3. Restart NeoTerm or reload profiles
  4. Profile appears in Profile Manager

Backup & Share Profiles

Export Profile:

  1. Copy profile file from ~/.config/neoterm/profiles/
  2. Share .nl file

Import Profile:

  1. Copy .nl file to ~/.config/neoterm/profiles/
  2. Restart NeoTerm
  3. Profile appears in list

Common Profile Configurations

Development Profile

Name: Python Dev
Shell: bash
Initial Command: source ~/venv/bin/activate && cd ~/projects
Color: Dracula
Font: Fira Code
Extra Keys: Enabled

Server Administration

Name: Server Admin
Shell: bash
Initial Command: ssh user@server.com
Color: Nord
Font: Hack
Extra Keys: Enabled
Bell: Disabled (for SSH noise)

Personal Usage

Name: Personal
Shell: zsh
Initial Command: neofetch && cd ~
Color: Catppuccin Mocha
Font: JetBrains Mono
Extra Keys: Disabled

Tmux Session

Name: Tmux
Shell: bash
Initial Command: tmux attach || tmux new
Color: Gruvbox Dark
Font: Source Code Pro
Extra Keys: Enabled

Quick Scripts

Name: Scripts
Shell: bash
Initial Command: cd ~/bin && ls -la
Color: Tokyo Night Dark
Font: Ubuntu Mono
Extra Keys: Enabled

Advanced Features

Shell-specific Profiles

Different shells for different use cases:

Bash Profile:

  • Standard, compatible, widely supported
  • Good for: General use, scripts, compatibility

Zsh Profile:

  • Advanced features, oh-my-zsh support
  • Good for: Power users, customization

Fish Profile:

  • Modern syntax, auto-suggestions
  • Good for: Interactive use, beginners

Startup Commands

Single command:

cd ~/projects

Multiple commands (use &&):

cd ~/work && git fetch && ls

Run script:

bash ~/startup.sh

Conditional execution:

[ -f ~/.profile ] && source ~/.profile

Environment Variables

Set in initial command:

export PATH=$PATH:~/bin && export EDITOR=vim

Or create a sourced script:

source ~/.neoterm-profile

Troubleshooting

Profile Not Applying

Symptom: Session doesn't use profile settings

Solutions:

  1. Check profile has non-empty name
  2. Verify settings are actually set in profile (not left empty)
  3. Create NEW session (changes don't apply to existing sessions)
  4. Check profile file exists in ~/.config/neoterm/profiles/

Color Scheme Stuck

Symptom: Changing global colors doesn't affect session

Cause: Session is using a profile with color scheme set

Solution: Either:

  1. Remove color scheme from profile (use global)
  2. Change color in profile itself
  3. Create new session without profile

Initial Command Fails

Symptom: Session starts but command doesn't run

Solutions:

  1. Check command syntax (test in normal terminal first)
  2. Use full paths for executables
  3. Check permissions
  4. View error: Initial command output appears in terminal

Profile Disappeared

Check:

  1. ls ~/.config/neoterm/profiles/
  2. File may have been deleted or corrupted
  3. Restore from backup if available

Technical Details

Implementation

Profiles are implemented in:

  • app/src/main/java/io/neoterm/component/profile/comp.kt - Profile component
  • app/src/main/java/io/neoterm/component/profile/data.kt - Profile data structures
  • app/src/main/java/io/neoterm/component/session/shell.kt - ShellProfile class

Default Profile

NeoTerm maintains a hidden default profile (__DEFAULT__) that:

  • Reflects current global settings
  • Used for sessions without explicit profile
  • Not shown in Profile Manager
  • Automatically updated when global settings change

Profile Validation

When loading profiles, NeoTerm validates:

  • ✓ File format is valid NeoLang
  • ✓ Profile meta-name matches expected type
  • ✓ Profile name is non-empty
  • ✓ Shell path exists (warns if missing)
  • ✓ Color scheme exists (falls back to default)
  • ✓ Font exists (falls back to default)

Related Documentation


Profile Component: component/profile/ Configuration Format: NeoLang (.nl) Storage: ~/.config/neoterm/profiles/