diff --git a/src/components/terminal/terminal.js b/src/components/terminal/terminal.js index 6a043c85b..642904664 100644 --- a/src/components/terminal/terminal.js +++ b/src/components/terminal/terminal.js @@ -598,7 +598,25 @@ export default class TerminalComponent { // Start AXS if not running if (!(await Terminal.isAxsRunning())) { - await Terminal.startAxs(false, () => {}, console.error); + const values = appSettings.value; + // Initialize terminal settings with defaults if not present + if (!values.terminalSettings) { + values.terminalSettings = { + ...DEFAULT_TERMINAL_SETTINGS, + fontFamily: + DEFAULT_TERMINAL_SETTINGS.fontFamily || + appSettings.value.fontFamily, + }; + } + + const terminalValues = values.terminalSettings; + + await Terminal.startAxs( + false, + () => {}, + console.error, + terminalValues.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..3659136d4 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/be-by.json b/src/lang/be-by.json index 610b9cd71..f4ed7a2c4 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index 3ba0457b9..01c2b49f3 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index 540ae2cc6..00bfe473e 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/de-de.json b/src/lang/de-de.json index 73737a7b7..0218f7311 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 4430a21da..bea594120 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -738,5 +738,7 @@ "login-to-view": "Please login to view this...", "iap-plugin-purchase-warning": "Purchased plugin are not synced to your Acode account. Use same Google account in play store to restore your purchase.", "iap-pro-purchase-warning": "This purchase will not be synced to your Acode account. Use same Google account in play store to restore your purchase.", - "confirm-login": "You are not singed in to Acode, sign in now?" + "confirm-login": "You are not singed in to Acode, sign in now?", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index 1d585322f..ff7ecf9f1 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index b3955d71d..1f055a126 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/he-il.json b/src/lang/he-il.json index a5db4616c..c9e369dc4 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index 01976709d..d3783e57b 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index 2c78d6bcc..169a1c5f5 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 68944e70f..c939fed93 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index c81c665d8..ea4e5b797 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/it-it.json b/src/lang/it-it.json index e4b105e50..b3359489e 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index ac8ebccd0..060328eb3 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index 6ea037895..ce2c72d5f 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index b64d5f556..9a4e3e182 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index 38130689c..95c405ec2 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index 3e5604699..6a2256d52 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index bb2dfb6d7..e241f1f3a 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index e6eb816d3..887a36ec3 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index c15689ad4..b5a0ad4d7 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index d8d17dc0e..4e3ceb625 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index 6778f14db..8b0c6746f 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 56b191927..4fd3ecc27 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index aa3b5dc25..d6a22658e 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index 4855de789..0799f5c20 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 89433267a..4c83a3e1f 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index eee440f35..dd4dbd419 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index 27e371bea..0dca5c3b0 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 23cb9a92a..c1e11681f 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -738,5 +738,7 @@ "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.", + "terminal:failsafe": "FailSafe mode", + "terminal:failsafe-info": "Start terminal with system shell" } diff --git a/src/plugins/terminal/scripts/init-alpine.sh b/src/plugins/terminal/scripts/init-alpine.sh index 8a0b1ecff..a91a1e12d 100644 --- a/src/plugins/terminal/scripts/init-alpine.sh +++ b/src/plugins/terminal/scripts/init-alpine.sh @@ -3,6 +3,29 @@ export PS1="\[\e[38;5;46m\]\u\[\033[39m\]@localhost \[\033[39m\]\w \[\033[0m\]\\ export HOME=/public export TERM=xterm-256color +INSTALLING=false +FAILSAFE=false + +# Parse internal flags +while [ $# -gt 0 ]; do + case "$1" in + --installing) + INSTALLING=true + shift + ;; + --failsafe) + FAILSAFE=true + shift + ;; + --) + shift + break + ;; + *) + break + ;; + esac +done required_packages="bash command-not-found tzdata wget" missing_packages="" @@ -30,7 +53,7 @@ if [ ! -f /linkerconfig/ld.config.txt ]; then fi -if [ "$1" = "--installing" ]; then +if [ "$INSTALLING" = true ]; then echo "Configuring timezone..." if [ -n "$ANDROID_TZ" ] && [ -f "/usr/share/zoneinfo/$ANDROID_TZ" ]; then @@ -47,7 +70,7 @@ if [ "$1" = "--installing" ]; then fi -if [ "$#" -eq 0 ]; then + echo "$$" > "$PREFIX/pid" chmod +x "$PREFIX/axs" @@ -243,10 +266,9 @@ 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 [ "$FAILSAFE" != true ]; then + #actual source + #everytime a terminal is started initrc will run + "$PREFIX/axs" -c "bash --rcfile /initrc -i" fi diff --git a/src/plugins/terminal/scripts/init-sandbox.sh b/src/plugins/terminal/scripts/init-sandbox.sh index 90154f793..6e4299532 100644 --- a/src/plugins/terminal/scripts/init-sandbox.sh +++ b/src/plugins/terminal/scripts/init-sandbox.sh @@ -112,4 +112,22 @@ ARGS="$ARGS --sysvipc" ARGS="$ARGS -L" -$PROOT $ARGS /bin/sh $PREFIX/init-alpine.sh "$@" +FAILSAFE=false +INSTALLING=false + +for arg in "$@"; do + case "$arg" in + --failsafe) + FAILSAFE=true + ;; + --installing) + INSTALLING=true + ;; + esac +done + +if [ "$FAILSAFE" = true ] && [ "$INSTALLING" != true ]; then + /system/bin/linker64 "$PREFIX/axs" -c "sh" +else + exec "$PROOT" $ARGS /bin/sh "$PREFIX/init-alpine.sh" "$@" +fi \ No newline at end of file diff --git a/src/plugins/terminal/www/Terminal.js b/src/plugins/terminal/www/Terminal.js index 6881973c4..42a8a09d4 100644 --- a/src/plugins/terminal/www/Terminal.js +++ b/src/plugins/terminal/www/Terminal.js @@ -8,11 +8,13 @@ const Terminal = { * @param {Function} [err_logger=console.error] - Function to log errors. * @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) { + async startAxs(installing = false, logger = console.log, err_logger = console.error,failsafe = false) { const filesDir = await new Promise((resolve, reject) => { system.getFilesDir(resolve, reject); }); + const failsafeArg = failsafe ? "--failsafe" : ""; + const [initAlpine, rmWrapper, initSandbox] = await Promise.all([ readAsset("init-alpine.sh"), readAsset("rm-wrapper.sh"), @@ -31,6 +33,7 @@ const Terminal = { let lastError = ""; Executor.start("sh", (type, data) => { + console.log(`[AXS] ${type}: ${data}`); logger(`${type} ${data}`); if (type === "stderr" && data) { @@ -48,7 +51,7 @@ const Terminal = { resolve(success); } }).then(async (uuid) => { - await Executor.write(uuid, `source ${filesDir}/init-sandbox.sh ${installing ? "--installing" : ""}; exit`); + await Executor.write(uuid, `source ${filesDir}/init-sandbox.sh ${installing ? "--installing" : ""} ${failsafeArg}; exit`); }).catch((error) => { const message = `Failed to start AXS: ${formatError(error)}`; this.lastInstallError = message; @@ -58,9 +61,10 @@ const Terminal = { }); } else { Executor.start("sh", (type, data) => { + console.log(`[AXS] ${type}: ${data}`); logger(`${type} ${data}`); }).then(async (uuid) => { - await Executor.write(uuid, `source ${filesDir}/init-sandbox.sh ${installing ? "--installing" : ""}; exit`); + await Executor.write(uuid, `source ${filesDir}/init-sandbox.sh ${installing ? "--installing" : ""} ${failsafeArg}; exit`); }); } }, @@ -133,20 +137,20 @@ const Terminal = { libproot32 = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libproot32.so"; libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libtalloc.so"; prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm64/libproot-xed.so"; - axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-musl-android-arm64`; + axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-pie-android-arm64`; alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-minirootfs-3.21.0-aarch64.tar.gz"; } else if (arch === "armeabi-v7a") { libproot = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libproot.so"; libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libtalloc.so"; prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/arm32/libproot-xed.so"; - axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-musl-android-armv7`; + axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-pie-android-armv7`; alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/armhf/alpine-minirootfs-3.21.0-armhf.tar.gz"; } else if (arch === "x86_64") { libproot = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libproot.so"; libproot32 = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libproot32.so"; libTalloc = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libtalloc.so"; prootUrl = "https://raw.githubusercontent.com/Acode-Foundation/Acode/main/src/plugins/proot/libs/x64/libproot-xed.so"; - axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-musl-android-x86_64`; + axsUrl = `https://github.com/bajrangCoder/acodex_server/releases/latest/download/axs-pie-android-x86_64`; alpineUrl = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-minirootfs-3.21.0-x86_64.tar.gz"; } else { throw new Error(`Unsupported architecture: ${arch}`); diff --git a/src/settings/terminalSettings.js b/src/settings/terminalSettings.js index 28abbf025..b33f1d44b 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["terminal:failsafe"], + checkbox: terminalValues.failsafeMode, + info: strings["terminal:failsafe-info"], + category: categories.maintenance, + }, { key: "backup", text: strings.backup,