# REPL.TerminalMenus.MultiSelectMenu: aborted vs. nothing selected

**URL:** <https://discourse.julialang.org/t/repl-terminalmenus-multiselectmenu-aborted-vs-nothing-selected/129505>\
**Category:** General Usage\
**Tags:** terminalmenus\
**Created:** [May 31, 2025, 5:46pm UTC](https://discourse.julialang.org/t/repl-terminalmenus-multiselectmenu-aborted-vs-nothing-selected/129505 "2025-05-31T17:46:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [May 31, 2025, 5:46pm UTC](https://discourse.julialang.org/t/repl-terminalmenus-multiselectmenu-aborted-vs-nothing-selected/129505/1 "2025-05-31T17:46:31Z")

</div>

In both cases it returnes empty array, though it’s obviously not (always) the same?

Is it possible to change the behavior? After reading the Julia [docs on TerminalMenus](https://docs.julialang.org/en/v1/stdlib/REPL/#TerminalMenus-2) I’m no wiser than before. ☹

AbstractMenu extension interface mentions the function `cancel(m::AbstractMenu)`, but what should I do with it? How to change the following code to get e.g. `nothing` on abort?

```julia
menu = MultiSelectMenu(["a", "b", "C"])
r = request(menu)

```

---

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [June 1, 2025, 12:09pm UTC](https://discourse.julialang.org/t/repl-terminalmenus-multiselectmenu-aborted-vs-nothing-selected/129505/2 "2025-06-01T12:09:52Z")

</div>

OK, looked into the source code, and can now think of two options, none of each I’d really like.

- Commit an act of piracy:

```julia
REPL.TerminalMenus.cancel(m::MultiSelectMenu) = error("aborting !") 

```

I could also provide my own error type, then catch and process it correspondingly.

- Or implement my own type `AbortableMultiSelectMenu`, basically copying the source of `MultiSelectMenu` with some adaptations, e.g. with the `cancel` function as above.

Any other ideas?
