# How to Disable Terminal Clear in holehe: Complete Guide to the --no-clear Flag

> Learn how to disable terminal clear in holehe using the --no-clear flag. Keep your command history and previous output visible when running email OSINT scans.

- Repository: [Palenath/holehe](https://github.com/megadose/holehe)
- Tags: how-to-guide
- Published: 2026-08-22

---

**Append the `--no-clear` flag to your holehe command to prevent the terminal from clearing before displaying email OSINT results, preserving your command history and previous output.**

holehe is an open-source email OSINT tool that checks for account registrations across hundreds of websites. By default, the application clears the terminal screen using ANSI escape codes before printing results. If you need to preserve terminal history, run holehe in automated scripts, or pipe output to other tools, you can disable terminal clear in holehe using a built-in command-line argument.

## How Terminal Clearing Works in holehe

The screen clearing behavior is implemented in the result display logic within [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py). When you execute a command, the tool checks whether the `--no-clear` flag was provided and adjusts the output behavior accordingly.

### Argument Parsing Configuration

In [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py), the argument parser defines the `--no-clear` option with `dest="noclear"` to store the flag value:

```python
parser.add_argument("--no-clear", ..., dest="noclear")

```

This creates the `args.noclear` boolean attribute that downstream functions reference to determine display behavior.

### The print_result Function Logic

The `print_result` function evaluates `args.noclear` to decide whether to execute the screen clear command. When `args.noclear` is `False` (the default), the code executes `print("\033[H\033[J")` to send ANSI escape sequences that move the cursor to the home position and clear the screen. When the flag is present, the value becomes `True` and the function skips the clear operation, printing only a newline instead.

## How to Use the --no-clear Flag

To disable terminal clear in holehe, append the flag to your standard command syntax.

### Basic Usage

Run holehe with the `--no-clear` option to keep previous terminal output visible:

```bash
holehe --no-clear user@example.com

```

### Combining with Other Options

The `--no-clear` flag works seamlessly with other output modifiers. You can disable both terminal clearing and color output, or export to CSV while preserving terminal history:

```bash

# Disable terminal clear and ANSI colors

holehe --no-clear --no-color user@example.com

# Export results to CSV without clearing screen

holehe --no-clear --csv user@example.com

```

## Summary

- holehe clears the terminal by default using `print("\033[H\033[J")` in the `print_result` function in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py)
- The `--no-clear` flag sets `args.noclear` to `True`, which skips the screen clearing operation
- Add the flag to any holehe command to preserve terminal history and previous command output
- The option combines safely with `--no-color`, `--csv`, and other command-line arguments according to the source code

## Frequently Asked Questions

### Why does holehe clear the terminal by default?

The default clear operation provides a clean interface for viewing OSINT results without interference from previous terminal commands. According to the holehe source code, this behavior is implemented in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) using ANSI escape codes that reset the cursor position and clear the screen before printing the email check results.

### Can I disable terminal clearing when running holehe in automated scripts?

Yes. When integrating holehe into bash scripts, CI/CD pipelines, or cron jobs, use `holehe --no-clear user@example.com` to prevent the terminal clear command from interfering with log capture or sequential output. This ensures all previous command output remains visible in your logs and audit trails.

### Does the --no-clear flag affect the tool's functionality?

No. Disabling terminal clear only affects the display layer in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) and does not modify how holehe performs email existence checks or interacts with target websites. The flag strictly controls whether the `print("\033[H\033[J")` statement executes before displaying results.

### Is there a way to permanently disable terminal clearing for all holehe commands?

Currently, holehe does not support a configuration file for persistent settings. You must include the `--no-clear` flag in every command, or create a shell alias such as `alias holehe='holehe --no-clear'` in your shell configuration to apply the setting automatically across all sessions.