For starters, let's copy all the relevant messages from the chat.
(Nah, copying is too much. Need to sum up later.)
**also see this https://hackmd.io/uKWxCD4LQUOZGtOdr9TO3w**
## Double-Escape
> [name=ratijas]
> double press Escape throws out of panels mode into r2 shell. It is also required to press Escape twice to drop focus from the File/Edit/etc menu at the top.
>
> Is that by design? Escape key is not documented in help window.
> [name=paπcake] [In reply to ratijas]
> Oops missed that msg. Escape char is sent to the console for other special keys. So handling esc is not easy if youbwant to make it portable without using ptyinfo. So yeah its intended to have this behaviour but not documwnted as long as it can change over time or on different terminals
> [name=ratijas] [In reply to paπcake]
> now that i think of it, i experienced same weirdness in vim: from insert mode press escape, and wait up to a second or so, to let that escape key code actually propagate and apply.
> [name=ratijas] [In reply to paπcake]
> I got back to my computer and tried again. Single escape doesn't work in radare2, even after a timeout. Only double pressing it works. Which is extremely confusing and obscure UX.
>
> Also, why using escapes? Panels (v) and visual (V) modes are not some lightweight OK/Cancel dialogues — why should they even respond to an escape key at all?
> [name=paπcake] [In reply to ratijas]
> Just use q
> [name=paπcake] Arrow keys, function keys, ctrl keys, mouse events are all handled by the escape character
> [name=ratijas] [In reply to paπcake]
> q works too, i suppose :)
> [name=paπcake] I tend to use only alphabumeric keys
> [name=paπcake] No arrows or esc
> [name=paπcake] Esc never plays well with terminals
> [name=ratijas]
> but still it doesn't feel right just being able to escape out of the panels mode. Ctrl-C feels right, q feels OK, escape feels like... too easy to close. Like if panels mode was something as disposable as aforementioned OK/Cancel dialogue or a notification pop-up.
> [name=ratijas] also, i found out about the possibility by escaping too much from some inner menus :)
>
> Closing seek-to-function pop-up was expected. Whole panels shutting down was kinda surprising.
> [name=paπcake]
> Why quiting when pressing esc is surprising at all?
> [name=ratijas] [In reply to paπcake]
> Well, they look like windows. You don't typically close desktop windows with escape.
> [name=ratijas] unlike menus, pop-ups, dialogues etc
> [name=ratijas]
> especially given that File/Edit/... menu also closes with escape, and even worse — double escape.
>
> let's say, i opened File menu, pressed Esc -> nothing happened, pressed few more times "just to be sure"ⓒ -> panels went down altogether with File menu -> surprise, we're back to `[0x0000]>` prompt
> [name=paπcake]
> Esc aliases to q
## Bird's eye view of modes

((Concept art))
TODO: make vector version of bird's eye view of modes using **dot**(1) or something similar.
> [name=ratijas] I also would like to make a bird's-eye view of all available modes and commands to transition between them.
>
> I think it could help solve inconsistency in naming stuff like: short/full names, upper/lowercase, menu vs mode etc.
> [name=ratijas] also, keys/commands terminology.
uhm isnt clear what a key is and what a command is?
> [name=ratijas] well, they are not distinguished in UI. that's all.
a command needs enter at the end to be executed and its usually composed by more than one key press, a key is just pressing one key.
> [name=ratijas] Yeah, maybe some little hint in title of help page would be just about enough.
help message in visual and panels need a lot of love , mainly from feedback from new users. so im glad to have this pad in here :)
> [name=ratijas] I already opened [an issue](https://github.com/radareorg/radare2/issues/18093) mentioning groupping commands. Now it also has to use word "keys" :) Groupping both keys and commands is essential.
Leaving a mode: 'q' key or 'q' command
* r2 -q -
* silent prompt, no command echo, useful for piping scripts to stdin
* r2 -
* standard shell
* r2 -e scr.color=0 -
* plaintext shell, useful for serial consoles (no \r or \x1b[2K] to clearline)
* visual mode
* using the V command
* use ! to toggle between panels and visual
* space toggles graph and disasm
* press : to enter prompt in visual to run commands, press enter (empty line) to go back to visual
* panels mode
* using the v command
* use ! to toggle between panels and visual
* m key opens the menu, q closes the menu
* same ':' as in visual. all those keys use to work on all interactive modes.
* graph mode
* VV or pressing space in visual/panels
* cursor (moving basic blocks around) is not a separate mode which a user can be `q`uit from. Maybe it should be? At least, there's a mark `(cursor)` appearing at the top left.
* mount shell
* ms command
* rlang shell
* #! command enters a python/node/... shell to interact with current session via r2pipe or rlang
* various
* inconsistency: why in prompt seeking is `s` but in visual mode is `g`?
* some commands launch local one-off prompts, half of them can be closed via backspace when empty, others don't. For example, `V` + `f` shows "flag name" prompt which can't be closed with backspace.
* visual glitch: immediately after exiting from panels mode to prompt, cursor is still colored like panels' borders.
* visual glitch: in Visual Graph modes, top row is used to display currently displayed command, but right after the last character of the command, there might be some extra characters (2 columns, to be precise) rendered from a graph view. If first of those two characters also starts new ANSI escape color sequence, they'll be colored, otherwise default like the command on the left of them.
* visual glitch: Color at the end of `f=` bar chart is not reset. Even the cursor is green after that.

* Fix `aaf?` help.
---
> [name=ratijas]
> there's a menu which closes instantly upon pressing Escape.
>
> Go into Visual Graph Mode (VV), select some basic block with more than one input or output, and press i or I to select input node or output node by index respectively. When r2 prompts for which one you'd like to seek to, press Escape.
>
> Result: prompt with input/output nodes immediately closes.
> [name=ratijas]
so, it seems it should be possible to gracefully quit from panels or File/etc menu via single Escape.
---
> [name=ratijas]
Variables like `$FS`, `$$` etc have to be called something like "special variables" or "magic variables" to avoid confusion with variables defined in binary code of disassembled functions.
---
https://book.rada.re/basic_commands/dietline.html
Dietline page mentions some kinds of modes, calling them "all radare2 subshells - main prompt, SDB shell, visual prompt, and offsets prompt".
> [name=ratijas] I don't think "visual prompt" is a particularly correct term.
---
## Panels scrolling bug
In Panels Mode, panels other than Disassembly and Help are not reacting to the `h` key. They are supposed to be scrollable by `hjkl`, but once you scrolled to the right with `l` (little L), you can't move back by pressing `h`.
As a temporary workaround, scrolling can be reset by clicking on an empty space inside a problematic panel.
Context thread: https://t.me/radare/203893
Fixed by https://github.com/radareorg/radare2/pull/18190
---
## Graph command changes settings
Diff graph (`agd`) subcommands unexpectedly changed settings at least for graph utf vs. ascii borders, and for color scheme.
Things that break stuff:
- `agd*`
- `agdd`
- `agdg`
- `agdk`
- `agdt`
- `agdv`
Things that are going good:
- Just `agd` by itself;
- `agdj`
- `agdw`
#WTF
---
## `afi` doesn't look right
It starts with weird `#`-only line, and the last line is a mess:
```
[0x00001070]> afi
#
offset: 0x00001070
name: entry0
size: 46
[...]
args: 1
arg int64_t arg3 @ rdx
diff: type: matchaddr: 0x1070function: entry0
```
Last line bug only happens after broken `agd` command.
## `f=` output is not sorted?
At the first sight, sections, segments, functions are all intermixed, which little sense to use this command at all.
Actually, it is sorted by addresses. It seems like position on a bar is relative to the section to which that flag belongs to, but it's not always the case. Bar chart just looks weird and pointless. Its meaning should be documented better.
## Parsing size in `/p`
Search commands `/p` and `/P` can't accept any 'size' expect simple decimal integers. The complaint here is the hex is not accepted.
```
[0x00402030]> /p 0x10 @ 0x00402000
Invalid pattern size (must be > 0)
[0x00402030]> /p 16 @ 0x00402000
-- 0 7fffffffffffffff
Searching patterns between 0x00000000 and 0x7fffffffffffffff
bytes: 0: ffffffffffffffffffffffffffffffff
found: 0: 0x00000000 0x00000010
count: 0: 2
0x00000011
```
## Cursor mode
Respect utf8 settings to use unicode borders instead of ASCII around hex data.
## Memory maps
`dmq` seems to be doing something different than just `dm`, but it is not documented in `dm?`.
## Memory maps
How they work? General high-level overview is needed.
```
o?
[...]
| op[r|n|p|fd] select priorized file by fd (see ob), opn/opp/opr = next/previous/rotate
```
-- maybe "prioritized"?
## Server rap://
Server instance of radare may be killed by simply resizing terminal window due to receiving signal SIGWINCH. See also: **signal**(7).
Minimal example:
```shell=
$ radare2 rap://:1234
rap: listening at port 1234 ssl off
RAP Server started (rap.loop=true)
accept: Interrupted system call
[r] Cannot open 'rap://'
```
Example after opening client session:
```shell
$ radare2 rap://:1234
rap: listening at port 1234 ssl off
RAP Server started (rap.loop=true)
rap: client connected
open (1): Warning: run r2 with -e io.cache=true to fix relocations in disassembly
(flags: 0) len: 8 filename: '/bin/ls'
[rap] unknown command 0x08
rap: waiting for new connection
accept: Interrupted system call
[r] Cannot open 'rap://'
```