Initial public release of Warp.

Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
David Stern
2026-04-28 08:43:33 -05:00
commit 0dbd3d567a
4982 changed files with 1431549 additions and 0 deletions
@@ -0,0 +1,6 @@
brew install tmux
if test $status -eq 0
tmux -Lwarp -CC
exit
end
@@ -0,0 +1,29 @@
set INSTALL_TMUX 'set -e
_on_error() {
local _msg=$(printf "{\"hook\": \"TmuxInstallFailed\", \"value\": { \"line\": \"$1\", \"command\": \"$2\" } }" | command -p od -An -v -tx1 | command -p tr -d " \n")
printf '\''\033\120\044\144%s\234'\'' "$_msg"
rm -rf "$HOME/.warp/tmux"
}
trap "_on_error \"\${LINENO}\" \"\$BASH_COMMAND\"" ERR
mkdir -p $HOME/.warp/tmux
pushd "$HOME/.warp/tmux"
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH_NAME=amd64 ;;
amd64) ARCH_NAME=amd64 ;;
aarch64) ARCH_NAME=arm64 ;;
*) echo "Unsupported architecture $ARCH"; exit 1 ;;
esac
URL="https://github.com/warpdotdev/portable-tmux/releases/download/tmux-3.5a/tmux-${ARCH_NAME}.tar.gz"
(curl -o tmux.tar.gz -L $URL || wget -O tmux.tar.gz $URL) && tar -xf tmux.tar.gz
INSTALL_PATH="$HOME/.warp/tmux/local"
echo "TERM=tmux-256color LD_LIBRARY_PATH=\"$INSTALL_PATH/lib\" TERMINFO=\"$INSTALL_PATH/share/terminfo/\" \"$INSTALL_PATH/bin/tmux\" \"\$@\";" > ~/.warp/tmux/execute_tmux.sh
chmod +x ~/.warp/tmux/execute_tmux.sh;'
bash -c "$INSTALL_TMUX" && ~/.warp/tmux/execute_tmux.sh -Lwarp -CC && exit
@@ -0,0 +1,80 @@
function _is
command -v $argv[1] >/dev/null 2>&1
end
function _log
set _hook $argv[1]
set _value $argv[2]
set _m (printf "{\"hook\": \"%s\", \"value\": %s}" $_hook $_value | od -An -v -tx1 | tr -d " \n")
printf '\033\120\044\144%s\234' $_m
end
function _err
_log RemoteWarpificationIsUnavailable $argv[1]
end
function _system_details
set -l OS (uname)
set -l PK ""
if test "$OS" = "Darwin"
if _is brew
set PK "homebrew"
end
else if test "$OS" = "Linux"
if _is pacman
set PK "pacman"
else if _is zypper
set PK "zypper"
else if _is dnf
set PK "dnf"
else if _is yum; and _is yumdownloader
set PK "yum"
else if _is apt
set PK "apt"
end
end
set -l CHECK (begin; command -v sudo > /dev/null 2>&1 && sudo -vn && sudo -ln; end 2>&1)
set -l RA "no_root_access"
if string match -qr '.*(may run|a password).*' "$CHECK"
set RA "can_run_sudo"
else if test (id -u) -eq 0; and test (whoami) = "root"
set RA "is_root"
end
set -l WH $( [ -w ~ ] && echo true || echo false )
printf '%s' "{\"os\": \"$OS\", \"pkg\": \"$PK\", \"shell\": \"fish\", \"root_access\": \"$RA\", \"writable_home\": $WH}"
end
# _check_tmux is used in the install script post install!
function _check_tmux
set -g TMUX ""
if _is tmux
set TMUX "tmux"
_log SshTmuxInstaller "\"user\""
else if _is $HOME/.warp/tmux/execute_tmux.sh
set TMUX "$HOME/.warp/tmux/execute_tmux.sh"
_log SshTmuxInstaller "\"warp\""
end
if test -n "$TMUX"
command $TMUX -V | awk '{print $2}' | read VER;
if test -z "$VER"
_err "\"TmuxFailed\""
else if test (printf '%s\n' "$VER" "2.9" | sort -V | tail -n1) = "2.9"
set -l DETAILS (_system_details)
_err "{\"UnsupportedTmuxVersion\": $DETAILS}"
else;
return 0
end
else;
set -l DETAILS (_system_details)
_err "{\"TmuxNotInstalled\": $DETAILS}"
end
return 1
end
_check_tmux; and command $TMUX -Lwarp -CC; and exit
@@ -0,0 +1,51 @@
function _is
command -v $argv[1] >/dev/null 2>&1
end
function _l
set _m (printf "{\"hook\": \"%s\", \"value\": %s}" $argv[1] $argv[2] | od -An -v -tx1 | tr -d " \n")
printf '\033\120\044\144%s\234' $_m
end
function _e
_l RemoteWarpificationIsUnavailable $argv[1]
end
function _sd
set -l PK ""
if _is brew
set PK "homebrew"
end
printf '{"os": "Darwin", "pkg": "%s", "shell": "fish", "root_access": "no_root_access", "writable_home": %s}' "$PK" $( [ -w ~ ] && echo true || echo false )
end
# _check_tmux is used in tmux install script post install!
function _check_tmux
set -g TMUX "$HOME/.warp/tmux/execute_tmux.sh"
if _is "$TMUX"
_l SshTmuxInstaller "\"warp\""
else if _is tmux
set TMUX "tmux"
_l SshTmuxInstaller "\"user\""
end
if test -n "$TMUX"
$TMUX -V | awk '{print $2}' | read V;
if test -z "$V"
_e "\"TmuxFailed\""
else if test (printf '%s\n' "$V" "2.9" | sort -V | tail -n1) = "2.9"
set -l D (_sd)
_e "{\"UnsupportedTmuxVersion\": $D}"
else;
return 0
end
else;
set -l D (_sd)
_e "{\"TmuxNotInstalled\": $D}"
end
return 1
end
_check_tmux; and $TMUX -Lwarp -CC; and exit