# Copy button in documentation copies prompt and result along with code

**URL:** <https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963>\
**Category:** Internals & Design\
**Created:** [May 16, 2023, 11:36pm UTC](https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963 "2023-05-16T23:36:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chunjiw](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@chunjiw](https://discourse.julialang.org/u/chunjiw)\
**Post date:** [May 16, 2023, 11:36pm UTC](https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963/1 "2023-05-16T23:36:22Z")

</div>

Proud Julia user here, but I am quite surprised that copy buttons in, for example, [docs for joinpath](https://docs.julialang.org/en/v1/base/file/#Base.Filesystem.joinpath) gives such result, e.g.

```julia
julia> joinpath(["/home/myuser", "example.jl"])
"/home/myuser/example.jl"

```

To me it makes much more sense if the copy button only copies the code, e.g.

```julia
joinpath(["/home/myuser", "example.jl"])

```

Is this by design, or is this an oversight?

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [May 17, 2023, 12:03am UTC](https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963/2 "2023-05-17T00:03:34Z")

</div>

The REPL has a feature called [prompt pasting](https://docs.julialang.org/en/v1/stdlib/REPL/#The-different-prompt-modes) that ignores the `julia> ` prompt and only interprets the statement when this string pasted into the REPL.

---

<div class="post-metadata">

**Author:** ![chunjiw](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@chunjiw](https://discourse.julialang.org/u/chunjiw)\
**Post date:** [May 17, 2023, 12:11am UTC](https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963/3 "2023-05-17T00:11:05Z")

</div>

Thanks! and…

> This feature does not work on the standard Windows command prompt due to its limitation at detecting when a paste occurs.

That’s … not so great …

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [May 17, 2023, 12:12am UTC](https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963/4 "2023-05-17T00:12:45Z")

</div>

A common statement when Windows is involved.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [May 21, 2023, 9:29am UTC](https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963/5 "2023-05-21T09:29:47Z")

</div>

Don’t use Cmd. PowerShell is still bad but many times better. To rice it, you can use it in the Windows Terminal, which is actually half decent.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [May 21, 2023, 9:34am UTC](https://discourse.julialang.org/t/copy-button-in-documentation-copies-prompt-and-result-along-with-code/98963/6 "2023-05-21T09:34:33Z")

</div>

Prompt pasting doesn’t work anywhere on Windows for me, not in the new Terminal with Powershell or anything else.

Anyway, it’s an unnecessary workaround for the problem reported by the OP.
