Skip to content

Commit

Permalink
snapcraft: call tput cols only once during completion
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
(cherry picked from commit 55c4560)
  • Loading branch information
simondeziel authored and tomponline committed Dec 12, 2024
1 parent fbbf0e6 commit 516a582
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1576,8 +1576,8 @@ parts:
mkdir -p "${CRAFT_PART_INSTALL}/etc/bash_completion.d/"
# Snapd requires the unaliased command `lxd.lxc` to be supplied as the first command for completion to be detected
set_cmds='s/^\s*complete.*__start_lxc /&lxd.lxc /'
# When executed by Snapd, the COLUMNS shell value is unset, so use $(tput cols) instead
set_cols='s/COLUMNS/$(tput cols)/'
# When executed by snapd, the COLUMNS shell value is unset, so use $(tput cols) instead
set_cols='s/# $COLUMNS.*/COLUMN="$(tput cols)" \# store the current shell width./'
# When executed by snapd, the `compopt` support detection doesn't work so fake that it is always `builtin`
set_compopt='s|$(type -t compopt)|"builtin"|'
# Modify requestComp variable to use lxc based on context ($SNAP/bin/lxc in Snap environment)
Expand Down

0 comments on commit 516a582

Please sign in to comment.