Intelligent Copy All (Prompt, Command, Output) is needed, which prefaces command

Open
#2,800 6 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Start by tracing the existing Copy Both behavior and the handling of Copy Command versus Copy Prompt. The change is done when Copy Both prefixes the command with a simple $ marker while Copy Command remains unchanged; the issue also describes # for root as a possible bonus.

Written by the indexing model from the issue text.

Description

area:shell-terminal enhancement triaged
Discord username (optional)

No response

Describe the solution you'd like?

I'd like to be able to copy the command and output (aka Copy Both) from a block, and paste it into e.g. Slack, so that it is clear it is a shell command and resulting output — the normal convention for this is to preface the command with a prompt marker, $, e.g.:

$ echo hello
hello

Important feature because I basically do it all the time.

Is your feature request related to a problem? Please describe.

Currently, if you use Copy Both, you get the command output, but without any prompt marker, e.g.:

echo hello
hello

It's not 100% clear/doesn't follow convention, that echo hello was entered at the shell prompt, and hello is the output.

Additional context

There are two workarounds:

  1. Copy Both, paste into e.g. Slack, manually add $ to the front of the command
    Pros: not that hard
    Cons: manual effort

  2. Copy Prompt, paste, Copy Both, paste
    Pros: includes original prompt
    Cons: default prompt in Warp is a two-liner, many people have complex prompts, desired convention for showing examples is just a simple $

As a bonus, it would be super-ideal if Warp could preface the command with $ for a normal user, and # for root. This is also a widely-used convention on the web.

Addendum for clarity: Copy Command alone should still not preface with $ or #, because a) that is convention, b) if you're just copying the command it's often to paste and run, verbatim.

How important is this feature to you?

4

Warp Internal (ignore) - linear-label:770f6576-d6c0-4e4f-a259-fc64b5156087

None

Dominant language
Rust
Stars
65.1k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from warpdotdev/warp

All issues in warpdotdev/warp

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.