Skip to content

Commit a058ac4

Browse files
ZeroPointEnergybhush9
authored andcommitted
fix terminal size in chroot
1 parent 5f32160 commit a058ac4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

halium-chroot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ umount_all()
3737
mount_all > /dev/null
3838

3939
CHROOT='TERM=linux HOME=/root PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH chroot /target'
40+
LINES=$(tput lines)
41+
COLUMNS=$(tput cols)
4042

4143
if [ $# -eq 0 ]
4244
then # Interactive shell
4345
if [ $(which tmux) ]
4446
then # with tmux installed
4547
tmux new-session -s halium-adb -d 'adb shell'
4648
sleep 1
49+
let LINES-=1
50+
tmux send-keys -t halium-adb "export LINES=${LINES}; export COLUMNS=${COLUMNS}"$'\n'
4751
tmux send-keys -t halium-adb "${CHROOT} /bin/bash; exit"$'\n'
4852
tmux attach -t halium-adb
4953
else # without tmux installed

0 commit comments

Comments
 (0)