EntityId
A tmux object id, typed by what it names.
Source and package
- Qualified name
-
libtmux::Entity Id - Namespace
- libtmux
- Package
- libtmux-cxx
- Source
- include/libtmux/entities.hpp
-
Description#
tmux spells these
$0,@1and%2. The prefix says which kind it is, and nothing in the type did: six accessors returnedstd::string_view, so a window id compiled wherever a pane id belonged, andpane.id() == window.id()was a comparison that can never be true but always built.The string is reached through
value()rather than through a conversion. A conversion is what let the mix-up through in the first place: with one, everystd::string_viewparameter accepts any id again, and this would read as type safety while providing none.Comparing an id to plain text still works, because that cannot confuse two kinds —
pane.id() == "%0"asks something answerable. Comparing two ids of different kinds does not compile.