# How can I create a fancier REPL prompt with styled strings? (was: Make \`Base.textwidth\` ignore ANSI sequences)

**URL:** <https://discourse.julialang.org/t/how-can-i-create-a-fancier-repl-prompt-with-styled-strings-was-make-base-textwidth-ignore-ansi-sequences/120782>\
**Category:** General Usage\
**Tags:** strings, repl, colors\
**Created:** [October 1, 2024, 11:32am UTC](https://discourse.julialang.org/t/how-can-i-create-a-fancier-repl-prompt-with-styled-strings-was-make-base-textwidth-ignore-ansi-sequences/120782 "2024-10-01T11:32:46Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 1, 2024, 1:03pm UTC](https://discourse.julialang.org/t/how-can-i-create-a-fancier-repl-prompt-with-styled-strings-was-make-base-textwidth-ignore-ansi-sequences/120782/4 "2024-10-01T13:03:58Z")

</div>

> [@HanD](#):
>
> I was wondering if there was an easy workaround for this.

You could strip out the ANSI escapes (which are not part of Unicode) before calling `textwidth`, e.g. [Strange characters in windows terminal - #4 by digital\_carver](https://discourse.julialang.org/t/strange-characters-in-windows-terminal/89355/4)

But probably better to use StyledStrings

---

_[View the full topic](https://discourse.julialang.org/t/how-can-i-create-a-fancier-repl-prompt-with-styled-strings-was-make-base-textwidth-ignore-ansi-sequences/120782)._
