The `snap interfaces` command prints out a deprecation notice to stderr. This breaks the completion
support for interfaces, connect and disconnect commands like so:
```
$ snap connect <TAB>error: no interfaces found
error: no interfaces found
...
'snap interfaces' is deprecated; use 'snap connections'.
'snap interfaces' is deprecated; use 'snap connections'.
'snap interfaces' is deprecated; use 'snap connections'.
error: no interfaces found
error: no interfaces found
'snap interfaces' is deprecated; use 'snap connections'.
```
Ultimately, the snap command completion should switch to `snap connections`. However, for now try to
workaround the notice by redirecting stderr.
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
This was sometimes slightly annoying in porting.
5 is enough most of the time, 10 should be enough basically always,
without being too annoying if you don't need it.
Note: This includes a super cheesy thing to print variable contents.
The expect version has one that's a bit more elaborate (featuring a
marker setup), but tbh that doesn't seem to be worth it.
If we do need it, we can add it, but it seems more likely we'd just do
`set -S`, or do it in a check instead.
Prior to this change, the posix_spawn code paths used a fair amount of
manual management around its allocated structures (attrs and file actions).
Encapsulate this into a new class that manages memory management and error
handling.
On my system this printed just "Description:" without any additional
characters, so this awkward `sed` didn't match and produced *all
packages on one line*.
Tbh this should probably be rewritten, but first we'd have to find a
way to get proper output here.
This merges a collection of changes attempting to rationalize how fish
handles the tty size.
The basic problem this addresses is that, prior to this fix, a call to
`common_get_width()` could result in arbitary code execution, as it lazily
updates COLUMNS and LINES which fires events, etc. With the new design, we
explicitly track the 'last known' tty size and also whether it is known stale,
and update it only at defined points.
This stuff is fraught and tricky, and so it is a merge commit so that if
something breaks, we can revert the whole thing and not end up with two
sources of termsize truth. Knock on wood.
Finish the transition to termsize.h. Remove the scary termsize bits
from common.cpp, which can throw off events at arbitrary calls and are
dangerously reentrant. Migrate everyone to the new termsize.h.
fish's handling of terminal sizes is currently rather twisted. The
essential problem is that the terminal size may change at any point from a
SIGWINCH, and common_get_{width,height} may modify it and post variable
change events from arbitrary locations.
Tighten up the semantics. Assign responsibility for managing the tty size
to a new class, `termsize_container_t`. Rationalize locking and reentrancy.
Explicitly nail down the relationship between $COLUMNS/$LINES and the tty
size. The new semantics are: whatever changed most recently takes
precendence.
Prior to this fix, fish would attempt to resize the terminal via
TIOCSWINSZ, which was added as part of #3740. In practice this probably
never did anything useful since generally only the tty master can use
this. Remove the support and note it in the changelog.
Prior to this fix, s_reset would attempt to reset the screen, optionally
using the PROMPT_SP hack to go to the next line. This in turn required
passing in the screen width even if it wasn't needed (because we were
not going to abandon the line). Factor this into two functions:
- s_reset_line which does not apply the hack
- s_reset_abandoning_line which applies the PROMPT_SP hack