diff --git a/src/components/terminal/terminal.js b/src/components/terminal/terminal.js index 6a043c85b..87deb7b76 100644 --- a/src/components/terminal/terminal.js +++ b/src/components/terminal/terminal.js @@ -598,7 +598,13 @@ export default class TerminalComponent { // Start AXS if not running if (!(await Terminal.isAxsRunning())) { - await Terminal.startAxs(false, () => {}, console.error); + const terminalSettings = getTerminalSettings(); + await Terminal.startAxs( + false, + () => {}, + console.error, + terminalSettings.failsafeMode, + ); // Check if AXS started with interval polling const maxRetries = 10; diff --git a/src/components/terminal/terminalDefaults.js b/src/components/terminal/terminalDefaults.js index 4f42242e7..2a631cad1 100644 --- a/src/components/terminal/terminalDefaults.js +++ b/src/components/terminal/terminalDefaults.js @@ -15,6 +15,7 @@ export const DEFAULT_TERMINAL_SETTINGS = { imageSupport: false, fontLigatures: false, confirmTabClose: true, + failsafeMode: false, // Touch selection settings touchSelectionTapHoldDuration: 600, touchSelectionMoveThreshold: 8, diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index 87cfac68e..4b7bfe21b 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "لن تتم مزامنة عملية الشراء هذه مع حساب Acode الخاص بك. استخدم نفس حساب Google في متجر Play لاستعادة عملية الشراء.", "confirm-login": "لم تقم بتسجيل الدخول إلى Acode، هل تريد تسجيل الدخول الآن؟", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/be-by.json b/src/lang/be-by.json index 610b9cd71..8e0927b18 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Гэтая пакупка не будзе сінхранізавана з вашым уліковым запісам Acode. Выкарыстоўвайце той жа ўліковы запіс Google у Play Store для аднаўлення пакупкі.", "confirm-login": "Вы не ўвайшлі ў Acode, увайсці зараз?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index 3ba0457b9..9d3d5bdcd 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "এই ক্রয়টি আপনার Acode অ্যাকাউন্টের সাথে সিঙ্ক হবে না। আপনার ক্রয় পুনরুদ্ধার করতে প্লে স্টোরে একই Google অ্যাকাউন্ট ব্যবহার করুন।", "confirm-login": "আপনি Acode-এ সাইন ইন করেননি, এখন সাইন ইন করবেন?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index 540ae2cc6..91eb8a885 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Tento nákup nebude synchronizován s vaším účtem Acode. Pro obnovení nákupu použijte stejný účet Google v Obchodě Play.", "confirm-login": "Nejste přihlášeni do Acode, přihlásit se nyní?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/de-de.json b/src/lang/de-de.json index 73737a7b7..b677f72ff 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Dieser Kauf wird nicht mit Ihrem Acode-Konto synchronisiert. Verwenden Sie dasselbe Google-Konto im Play Store, um Ihren Kauf wiederherzustellen.", "confirm-login": "Sie sind nicht bei Acode angemeldet, jetzt anmelden?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 4430a21da..34d0fdf2f 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -446,6 +446,8 @@ "terminal:convert eol": "Convert EOL", "terminal:confirm tab close": "Confirm terminal tab close", "terminal:image support": "Image support", + "failsafe mode": "Failsafe mode", + "info-failsafeMode": "When enabled, the terminal will launch axs without proot. This is useful when proot is not working.", "terminal": "Terminal", "allFileAccess": "All file access", "fonts": "Fonts", diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index 1d585322f..7f7a58b98 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Esta compra no se sincronizará con tu cuenta de Acode. Usa la misma cuenta de Google en Play Store para restaurar tu compra.", "confirm-login": "No has iniciado sesión en Acode, ¿iniciar sesión ahora?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index b3955d71d..d80938950 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Cet achat ne sera pas synchronisé avec votre compte Acode. Utilisez le même compte Google dans le Play Store pour restaurer votre achat.", "confirm-login": "Vous n'êtes pas connecté à Acode, vous connecter maintenant ?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/he-il.json b/src/lang/he-il.json index a5db4616c..65572a3db 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "רכישה זו לא תסונכרן עם חשבון Acode שלך. השתמש באותו חשבון Google בחנות Play כדי לשחזר את הרכישה שלך.", "confirm-login": "אינך מחובר ל-Acode, להתחבר עכשיו?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index 01976709d..149a581b5 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "यह खरीदारी आपके Acode खाते से सिंक नहीं होगी। अपनी खरीदारी पुनर्स्थापित करने के लिए Play Store में उसी Google खाते का उपयोग करें।", "confirm-login": "आप Acode में साइन इन नहीं हैं, अभी साइन इन करें?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index 2c78d6bcc..32dbb4697 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Ez a vásárlás nem lesz szinkronizálva az Acode-fiókjával. Használja ugyanazt a Google-fiókot a Play Áruházban a vásárlás visszaállításához.", "confirm-login": "Nincs bejelentkezve az Acode-ba, bejelentkezik most?", "local word completion": "Szókiegészítés a helyi fájlból", - "settings-info-editor-local-word-completion": "Szavak ajánlása a jelenleg megnyitott fájlból." + "settings-info-editor-local-word-completion": "Szavak ajánlása a jelenleg megnyitott fájlból.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 68944e70f..6c9aa4c06 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Pembelian ini tidak akan disinkronkan ke akun Acode Anda. Gunakan akun Google yang sama di Play Store untuk memulihkan pembelian Anda.", "confirm-login": "Anda belum masuk ke Acode, masuk sekarang?", "local word completion": "Penyelesaian kata lokal", - "settings-info-editor-local-word-completion": "Sarankan kata dari berkas saat ini." + "settings-info-editor-local-word-completion": "Sarankan kata dari berkas saat ini.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index c81c665d8..65256a7b4 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "این خرید با حساب Acode شما همگام‌سازی نخواهد شد. برای بازیابی خرید خود از همان حساب Google در فروشگاه Play استفاده کنید.", "confirm-login": "شما وارد Acode نشده‌اید، اکنون وارد شوید؟", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/it-it.json b/src/lang/it-it.json index e4b105e50..9d9a4048f 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Questo acquisto non verrà sincronizzato con il tuo account Acode. Usa lo stesso account Google nel Play Store per ripristinare l'acquisto.", "confirm-login": "Non hai effettuato l'accesso ad Acode, accedere ora?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index ac8ebccd0..413f77afd 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "この購入はAcodeアカウントと同期されません。購入を復元するには、Playストアで同じGoogleアカウントを使用してください。", "confirm-login": "Acodeにサインインしていません。今すぐサインインしますか?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index 6ea037895..a64115d8c 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "이 구매는 Acode 계정과 동기화되지 않습니다. 구매를 복원하려면 Play 스토어에서 동일한 Google 계정을 사용하세요.", "confirm-login": "Acode에 로그인되어 있지 않습니다. 지금 로그인하시겠습니까?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index b64d5f556..8fe46b7db 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "ഈ വാങ്ങൽ നിങ്ങളുടെ Acode അക്കൗണ്ടുമായി സമന്വയിപ്പിക്കില്ല. നിങ്ങളുടെ വാങ്ങൽ പുനഃസ്ഥാപിക്കാൻ Play Store-ൽ അതേ Google അക്കൗണ്ട് ഉപയോഗിക്കുക.", "confirm-login": "നിങ്ങൾ Acode-ൽ സൈൻ ഇൻ ചെയ്തിട്ടില്ല, ഇപ്പോൾ സൈൻ ഇൻ ചെയ്യണോ?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index 38130689c..447b171ac 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "ဤဝယ်ယူမှုသည် သင့် Acode အကောင့်နှင့် ထပ်တူပြုမည်မဟုတ်ပါ။ သင့်ဝယ်ယူမှုကို ပြန်လည်ရယူရန် Play Store တွင် တူညီသော Google အကောင့်ကို အသုံးပြုပါ။", "confirm-login": "သင်သည် Acode သို့ အကောင့်ဝင်ထားခြင်းမရှိပါ၊ ယခု အကောင့်ဝင်မလား။", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index 3e5604699..31673cc84 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "ဤဝယ္ယူမႈသည္ သင့္ Acode အေကာင့္ႏွင့္ ထပ္တူျပဳမည္မဟုတ္ပါ။ သင့္ဝယ္ယူမႈကို ျပန္လည္ရယူရန္ Play Store တြင္ တူညီေသာ Google အေကာင့္ကို အသုံးျပဳပါ။", "confirm-login": "သင္သည္ Acode သို႔ အေကာင့္ဝင္ထားျခင္းမရွိပါ၊ ယခု အေကာင့္ဝင္မလား။", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index bb2dfb6d7..8703d8408 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Ten zakup nie zostanie zsynchronizowany z Twoim kontem Acode. Użyj tego samego konta Google w Sklepie Play, aby przywrócić zakup.", "confirm-login": "Nie jesteś zalogowany do Acode, zalogować się teraz?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index e6eb816d3..2abc28189 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Esta compra não será sincronizada com sua conta Acode. Use a mesma conta do Google na Play Store para restaurar sua compra.", "confirm-login": "Você não está conectado ao Acode, conectar agora?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index c15689ad4..a337bf6eb 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "ਇਹ ਖਰੀਦ ਤੁਹਾਡੇ Acode ਖਾਤੇ ਨਾਲ ਸਿੰਕ ਨਹੀਂ ਹੋਵੇਗੀ। ਆਪਣੀ ਖਰੀਦ ਨੂੰ ਬਹਾਲ ਕਰਨ ਲਈ Play Store ਵਿੱਚ ਉਹੀ Google ਖਾਤਾ ਵਰਤੋ।", "confirm-login": "ਤੁਸੀਂ Acode ਵਿੱਚ ਸਾਈਨ ਇਨ ਨਹੀਂ ਹੋ, ਹੁਣੇ ਸਾਈਨ ਇਨ ਕਰੋ?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index d8d17dc0e..ffe44066e 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Эта покупка не будет синхронизирована с вашей учетной записью Acode. Используйте ту же учетную запись Google в Play Store для восстановления покупки.", "confirm-login": "Вы не вошли в Acode, войти сейчас?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index 6778f14db..52cf2647a 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Ang pagbiling ito ay hindi masi-sync sa iyong Acode account. Gamitin ang parehong Google account sa Play Store upang maibalik ang iyong pagbili.", "confirm-login": "Hindi ka naka-sign in sa Acode, mag-sign in ngayon?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 56b191927..3bfd3ee4d 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Bu satın alım Acode hesabınızla senkronize edilmeyecektir. Satın alımınızı geri yüklemek için Play Store'da aynı Google hesabını kullanın.", "confirm-login": "Acode'a giriş yapmadınız, şimdi giriş yapmak ister misiniz?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index aa3b5dc25..eea834eab 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Ця покупка не буде синхронізована з вашим обліковим записом Acode. Використовуйте той самий обліковий запис Google у Play Store для відновлення покупки.", "confirm-login": "Ви не ввійшли в Acode, увійти зараз?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index 4855de789..09118890d 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Ushbu xarid Acode hisobingiz bilan sinxronlanmaydi. Xaridingizni tiklash uchun Play Store'da xuddi shu Google hisobidan foydalaning.", "confirm-login": "Siz Acode'ga kirmagansiz, hozir kirasizmi?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 89433267a..912c95e84 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "Giao dịch mua này sẽ không được đồng bộ hóa với tài khoản Acode của bạn. Sử dụng cùng một tài khoản Google trên Play Store để khôi phục giao dịch mua của bạn.", "confirm-login": "Bạn chưa đăng nhập vào Acode, đăng nhập ngay bây giờ?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index eee440f35..7010c579d 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "此购买不会同步到您的 Acode 账户。请在 Play 商店中使用相同的 Google 账户来恢复您的购买。", "confirm-login": "您尚未登录 Acode,立即登录?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index 27e371bea..0d69e54f4 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "此購買不會同步到您的 Acode 帳戶。請在 Play 商店中使用相同的 Google 帳戶來恢復您的購買。", "confirm-login": "您尚未登入 Acode,立即登入?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 23cb9a92a..53ad8c665 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -738,5 +738,6 @@ "iap-pro-purchase-warning": "此購買不會同步到您的 Acode 帳戶。請在 Play 商店中使用相同的 Google 帳戶來恢復您的購買。", "confirm-login": "您尚未登入 Acode,立即登入?", "local word completion": "Local word completion", - "settings-info-editor-local-word-completion": "Suggest words from the current file." + "settings-info-editor-local-word-completion": "Suggest words from the current file.", + "failsafe mode": "Failsafe mode" } diff --git a/src/plugins/terminal/scripts/init-alpine.sh b/src/plugins/terminal/scripts/init-alpine.sh index 8a0b1ecff..7332c3d5d 100644 --- a/src/plugins/terminal/scripts/init-alpine.sh +++ b/src/plugins/terminal/scripts/init-alpine.sh @@ -29,30 +29,12 @@ if [ ! -f /linkerconfig/ld.config.txt ]; then touch /linkerconfig/ld.config.txt fi +# One-time initialization logic +# We do this here so it's available even if first run is failsafe +chmod +x "$PREFIX/axs" -if [ "$1" = "--installing" ]; then - echo "Configuring timezone..." - - if [ -n "$ANDROID_TZ" ] && [ -f "/usr/share/zoneinfo/$ANDROID_TZ" ]; then - ln -sf "/usr/share/zoneinfo/$ANDROID_TZ" /etc/localtime - echo "$ANDROID_TZ" > /etc/timezone - echo "Timezone set to: $ANDROID_TZ" - else - echo "Failed to detect timezone" - fi - - mkdir -p "$PREFIX/.configured" - echo "Installation completed." - exit 0 -fi - - -if [ "$#" -eq 0 ]; then - echo "$$" > "$PREFIX/pid" - chmod +x "$PREFIX/axs" - - if [ ! -e "$PREFIX/alpine/etc/acode_motd" ]; then - cat < "$PREFIX/alpine/etc/acode_motd" +if [ ! -e "$PREFIX/alpine/etc/acode_motd" ]; then + cat < "$PREFIX/alpine/etc/acode_motd" Welcome to Alpine Linux in Acode! Working with packages: @@ -63,12 +45,12 @@ Working with packages: - Upgrade: apk update && apk upgrade EOF - fi +fi - # Create acode CLI tool - if [ ! -e "$PREFIX/alpine/usr/local/bin/acode" ]; then - mkdir -p "$PREFIX/alpine/usr/local/bin" - cat <<'ACODE_CLI' > "$PREFIX/alpine/usr/local/bin/acode" +# Create acode CLI tool +if [ ! -e "$PREFIX/alpine/usr/local/bin/acode" ]; then + mkdir -p "$PREFIX/alpine/usr/local/bin" + cat <<'ACODE_CLI' > "$PREFIX/alpine/usr/local/bin/acode" #!/bin/bash # acode - Open files/folders in Acode editor # Uses OSC escape sequences to communicate with the Acode terminal @@ -143,13 +125,13 @@ for arg in "$@"; do esac done ACODE_CLI - chmod +x "$PREFIX/alpine/usr/local/bin/acode" - fi + chmod +x "$PREFIX/alpine/usr/local/bin/acode" +fi - # Create initrc if it doesn't exist - #initrc runs in bash so we can use bash features +# Create initrc if it doesn't exist +#initrc runs in bash so we can use bash features if [ ! -e "$PREFIX/alpine/initrc" ]; then - cat <<'EOF' > "$PREFIX/alpine/initrc" +cat <<'EOF' > "$PREFIX/alpine/initrc" # Source rc files if they exist if [ -f "/etc/profile" ]; then @@ -243,10 +225,11 @@ fi chmod +x "$PREFIX/alpine/initrc" -#actual source -#everytime a terminal is started initrc will run -"$PREFIX/axs" -c "bash --rcfile /initrc -i" -else - exec "$@" +if [ "$1" = "--installing" ]; then + touch "$PREFIX/.configured" + exit 0 fi + +# Fallback to bash if no command specified +exec /bin/bash --rcfile /initrc diff --git a/src/plugins/terminal/www/Terminal.js b/src/plugins/terminal/www/Terminal.js index 6881973c4..8deb3f660 100644 --- a/src/plugins/terminal/www/Terminal.js +++ b/src/plugins/terminal/www/Terminal.js @@ -6,12 +6,20 @@ const Terminal = { * @param {boolean} [installing=false] - Whether AXS is being started during installation. * @param {Function} [logger=console.log] - Function to log standard output. * @param {Function} [err_logger=console.error] - Function to log errors. + * @param {boolean} [failsafeMode=false] - Whether to start AXS in failsafe mode (without proot). * @returns {Promise} - Returns true if installation completes with exit code 0, void if not installing */ - async startAxs(installing = false, logger = console.log, err_logger = console.error) { - const filesDir = await new Promise((resolve, reject) => { - system.getFilesDir(resolve, reject); - }); + async startAxs(installing = false, logger = console.log, err_logger = console.error, failsafeMode = false) { + const [filesDir, arch] = await Promise.all([ + new Promise((resolve, reject) => { + system.getFilesDir(resolve, reject); + }), + new Promise((resolve, reject) => { + system.getArch(resolve, reject); + }), + ]); + + const linker = (arch === "arm64-v8a" || arch === "x86_64") ? "/system/bin/linker64" : "/system/bin/linker"; const [initAlpine, rmWrapper, initSandbox] = await Promise.all([ readAsset("init-alpine.sh"), @@ -60,7 +68,11 @@ const Terminal = { Executor.start("sh", (type, data) => { logger(`${type} ${data}`); }).then(async (uuid) => { - await Executor.write(uuid, `source ${filesDir}/init-sandbox.sh ${installing ? "--installing" : ""}; exit`); + if (failsafeMode) { + await Executor.write(uuid, `chmod +x ${filesDir}/axs; echo $$ > ${filesDir}/pid; ${linker} ${filesDir}/axs -c "sh -i"; exit`); + } else { + await Executor.write(uuid, `source ${filesDir}/init-sandbox.sh ${installing ? "--installing" : ""}; exit`); + } }); } }, @@ -495,5 +507,4 @@ function formatError(error) { return String(error); } - module.exports = Terminal; diff --git a/src/settings/terminalSettings.js b/src/settings/terminalSettings.js index 28abbf025..72ef694b9 100644 --- a/src/settings/terminalSettings.js +++ b/src/settings/terminalSettings.js @@ -195,6 +195,13 @@ export default function terminalSettings() { info: strings["info-confirmTabClose"], category: categories.session, }, + { + key: "failsafeMode", + text: strings["failsafe mode"], + checkbox: terminalValues.failsafeMode, + info: strings["info-failsafeMode"], + category: categories.session, + }, { key: "backup", text: strings.backup, @@ -286,6 +293,10 @@ export default function terminalSettings() { }, }); + if (key === "failsafeMode") { + toast("Restart terminal to apply changes"); + } + // Update any active terminal instances updateActiveTerminals(key, value); break;