past Verified current stable Not installed? Programming

Past / List Past Commands Current Session Ptghci

List Past Commands Current Session Ptghci

List previously executed commands from the current session in ptghci.

$
Terminal
%past

When To Use

When needing to quickly reference commands executed in the current REPL session.

Pro Tip

Employ `:hist` for more detailed command history options.

Anatomy of Output

Understanding the result

Command History: 5 commands listed. History Length

Indicates the count of commands available.

1. load ModuleA First Entry

Most recent command executed.

2. putStrLn 'Hello World' Second Entry

Output to the console.

Power User Variants

Optimized versions

past -v

List past commands with verbose formatting.

past --filter 'specific'

Filter past commands by a keyword.

Troubleshooting

Common pitfalls

No commands executed in this session.

Solution: Ensure commands were inputted during the current session.

Error: Command history not initialized.

Solution: Check session settings to ensure command history is enabled.

Warning: History limit reached; old commands purged.

Solution: Increase history limit in ptghci configuration.

Command Breakdown

What each part is doing

%past
Base Command
The executable that performs this operation. Here it runs Past before the shell applies any redirect operators.

Alternative Approaches

Comparable commands in other tools

Alternative programming tools for the same job.