Skip to content

Commit cc007e9

Browse files
Merge branch 'Acode-Foundation:main' into main
2 parents 4db085a + da47d95 commit cc007e9

File tree

18 files changed

+752
-131
lines changed

18 files changed

+752
-131
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Change Log
22

3+
## v1.11.5 (963)
4+
5+
* Alpine Linux Backend by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1401
6+
* fix: html escaping for console page by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1411
7+
* Create plugin for native libs by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1413
8+
* feat: terminal frontend by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1415
9+
* Update hu-hu.json translation by @summoner001 in https://github.com/Acode-Foundation/Acode/pull/1423, https://github.com/Acode-Foundation/Acode/pull/1425, https://github.com/Acode-Foundation/Acode/pull/1440
10+
* chore: update id-id.json translation by @hyperz111 in https://github.com/Acode-Foundation/Acode/pull/1424, https://github.com/Acode-Foundation/Acode/pull/1447
11+
* All file access permission for terminal by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1426
12+
* refactor: plugins page by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1428
13+
* Fixed infinite scrolling in case of filtering on both plugin page and sidebar
14+
* Ui improvements on plugin page
15+
* Revamped few themes(fixes visibility issue) and Added few new ones by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1430
16+
* New theme: Neon, Sunset, Glass, Glass Dark
17+
* Revamped themes: System (Dark & Light), Oled, Light
18+
* System theme option is available on free too.
19+
* fix: scaling issue by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1431
20+
* fix: quicktools toggler responsiveness(scaling) and migrate biome by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1442
21+
* chore: update ace to v1.43.2 by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1443
22+
* feat: add uninstall option in terminal setting and tab subtitle fixes by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1445
23+
* feat: alpine document provider(exposes terminal public dir to saf picker) by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1444
24+
* feat: improved logging + fix terminal installation failure by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1446
25+
* some terminal related quality improvements by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1449
26+
* fix: dont start selection in case of back gesture
27+
* remove useless border-radius from terminal container
28+
* fix: improve terminal cursor positioning for mobile keyboard events
29+
* fix: update terminal container background when theme changes
30+
* exclude alpine/public while backup by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1450
31+
* Custom port support in Terminal manager by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1459
32+
* 🌐 i18n(locale): update vietnamese translations by @Nekitori17 in https://github.com/Acode-Foundation/Acode/pull/1461
33+
* fix: infinite loading when previewing by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1460
34+
* Feat/some improvements to terminal and its api by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1463
35+
* Fixes/sidebar extension state by clearing and active autocompletion box background by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1466
36+
* feat: add terminal like search and replace history by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1467
37+
* fix: theme issue in terminal context menu
38+
* fix: prevent folder paste loops and improve SAF handling(termux) in cut operation by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1474
39+
- Add validation to prevent pasting folders into themselves or subdirectories
40+
- Implement special Termux SAF handling for cut operations with recursive file/folder moving
41+
- Fix createFileStructure to handle nested paths (foo/bar) for file:// URIs
42+
343
## v1.11.4 (962)
444

545
* Fix renaming current Termux URI file whilst viewing/editing it by @peasneovoyager2banana2

config.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8' ?>
2-
<widget id="com.foxdebug.acode" android-versionCode="962" version="1.11.4"
2+
<widget id="com.foxdebug.acode" android-versionCode="963" version="1.11.5"
33
xmlns="http://www.w3.org/ns/widgets"
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
xmlns:cdv="http://cordova.apache.org/ns/1.0">
@@ -37,7 +37,6 @@
3737
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
3838
<application android:networkSecurityConfig="@xml/network_security_config" />
3939
<application android:hardwareAccelerated="true" />
40-
<application android:requestLegacyExternalStorage="true" />
4140
<application android:largeHeap="true" />
4241
<application android:requestLegacyExternalStorage="true"/>
4342
</edit-config>

package-lock.json

Lines changed: 2 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.foxdebug.acode",
33
"displayName": "Acode",
4-
"version": "1.11.4",
4+
"version": "1.11.5",
55
"description": "Acode is a code editor for android",
66
"scripts": {
77
"lang": "node ./utils/lang.js",

src/components/terminal/terminal.js

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default class TerminalComponent {
3131
scrollOnUserInput: true,
3232
rows: options.rows || 24,
3333
cols: options.cols || 80,
34+
port: options.port || 8767,
3435
fontSize: terminalSettings.fontSize,
3536
fontFamily: terminalSettings.fontFamily,
3637
fontWeight: terminalSettings.fontWeight,
@@ -467,6 +468,8 @@ export default class TerminalComponent {
467468
position: relative;
468469
background: ${this.options.theme.background};
469470
overflow: hidden;
471+
padding: 0.25rem;
472+
box-sizing: border-box;
470473
`;
471474

472475
return this.container;
@@ -566,13 +569,16 @@ export default class TerminalComponent {
566569
rows: this.terminal.rows,
567570
};
568571

569-
const response = await fetch("http://localhost:8767/terminals", {
570-
method: "POST",
571-
headers: {
572-
"Content-Type": "application/json",
572+
const response = await fetch(
573+
`http://localhost:${this.options.port}/terminals`,
574+
{
575+
method: "POST",
576+
headers: {
577+
"Content-Type": "application/json",
578+
},
579+
body: JSON.stringify(requestBody),
573580
},
574-
body: JSON.stringify(requestBody),
575-
});
581+
);
576582

577583
if (!response.ok) {
578584
throw new Error(`HTTP error! status: ${response.status}`);
@@ -604,7 +610,7 @@ export default class TerminalComponent {
604610

605611
this.pid = pid;
606612

607-
const wsUrl = `ws://localhost:8767/terminals/${pid}`;
613+
const wsUrl = `ws://localhost:${this.options.port}/terminals/${pid}`;
608614

609615
this.websocket = new WebSocket(wsUrl);
610616

@@ -658,13 +664,16 @@ export default class TerminalComponent {
658664
if (!this.pid || !this.serverMode) return;
659665

660666
try {
661-
await fetch(`http://localhost:8767/terminals/${this.pid}/resize`, {
662-
method: "POST",
663-
headers: {
664-
"Content-Type": "application/json",
667+
await fetch(
668+
`http://localhost:${this.options.port}/terminals/${this.pid}/resize`,
669+
{
670+
method: "POST",
671+
headers: {
672+
"Content-Type": "application/json",
673+
},
674+
body: JSON.stringify({ cols, rows }),
665675
},
666-
body: JSON.stringify({ cols, rows }),
667-
});
676+
);
668677
} catch (error) {
669678
console.error("Failed to resize terminal:", error);
670679
}
@@ -684,7 +693,18 @@ export default class TerminalComponent {
684693
* @param {string} data - Data to write
685694
*/
686695
write(data) {
687-
this.terminal.write(data);
696+
if (
697+
this.serverMode &&
698+
this.isConnected &&
699+
this.websocket &&
700+
this.websocket.readyState === WebSocket.OPEN
701+
) {
702+
// Send data through WebSocket instead of direct write
703+
this.websocket.send(data);
704+
} else {
705+
// For local mode or disconnected terminals, write directly
706+
this.terminal.write(data);
707+
}
688708
}
689709

690710
/**
@@ -953,9 +973,12 @@ export default class TerminalComponent {
953973

954974
if (this.pid && this.serverMode) {
955975
try {
956-
await fetch(`http://localhost:8767/terminals/${this.pid}/terminate`, {
957-
method: "POST",
958-
});
976+
await fetch(
977+
`http://localhost:${this.options.port}/terminals/${this.pid}/terminate`,
978+
{
979+
method: "POST",
980+
},
981+
);
959982
} catch (error) {
960983
console.error("Failed to terminate terminal:", error);
961984
}

src/components/terminal/terminalManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ class TerminalManager {
472472
background: #1e1e1e;
473473
overflow: hidden;
474474
position: relative;
475+
padding: 0.25rem;
475476
}
476477
`;
477478
}

src/components/terminal/terminalTouchSelection.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
padding: 12px 16px;
7272
border: none;
7373
background: transparent;
74-
color: #fff;
74+
color: var(--primary-text-color);
7575
font-size: 14px;
7676
font-weight: 500;
7777
text-align: center;
@@ -85,12 +85,12 @@
8585

8686
.terminal-context-menu button:hover,
8787
.terminal-context-menu button:focus {
88-
background: #616161;
88+
background: var(--popup-border-color);
8989
outline: none;
9090
}
9191

9292
.terminal-context-menu button:active {
93-
background: #757575;
93+
background: rgba(var(--secondary-color), 0.5);
9494
}
9595

9696
@media (min-width: 768px) {

src/handlers/quickTools.js

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import quickTools from "components/quickTools";
22
import actionStack from "lib/actionStack";
3+
import searchHistory from "lib/searchHistory";
34
import appSettings from "lib/settings";
45
import searchSettings from "settings/searchSettings";
56
import KeyboardEvent from "utils/keyboardEvent";
@@ -75,6 +76,67 @@ appSettings.on("update:quicktoolsItems:after", () => {
7576
}, 100);
7677
});
7778

79+
// Initialize history navigation
80+
function setupHistoryNavigation() {
81+
const { $searchInput, $replaceInput } = quickTools;
82+
83+
// Search input history navigation
84+
if ($searchInput.el) {
85+
$searchInput.el.addEventListener("keydown", (e) => {
86+
if (e.key === "ArrowUp") {
87+
e.preventDefault();
88+
const newValue = searchHistory.navigateSearchUp($searchInput.el.value);
89+
$searchInput.el.value = newValue;
90+
// Trigger search
91+
if (newValue) find(0, false);
92+
} else if (e.key === "ArrowDown") {
93+
e.preventDefault();
94+
const newValue = searchHistory.navigateSearchDown(
95+
$searchInput.el.value,
96+
);
97+
$searchInput.el.value = newValue;
98+
// Trigger search
99+
if (newValue) find(0, false);
100+
} else if (e.key === "Enter" || e.key === "Escape") {
101+
// Reset navigation on enter or escape
102+
searchHistory.resetSearchNavigation();
103+
}
104+
});
105+
106+
// Reset navigation when user starts typing
107+
$searchInput.el.addEventListener("input", () => {
108+
searchHistory.resetSearchNavigation();
109+
});
110+
}
111+
112+
// Replace input history navigation
113+
if ($replaceInput.el) {
114+
$replaceInput.el.addEventListener("keydown", (e) => {
115+
if (e.key === "ArrowUp") {
116+
e.preventDefault();
117+
const newValue = searchHistory.navigateReplaceUp(
118+
$replaceInput.el.value,
119+
);
120+
$replaceInput.el.value = newValue;
121+
} else if (e.key === "ArrowDown") {
122+
e.preventDefault();
123+
const newValue = searchHistory.navigateReplaceDown(
124+
$replaceInput.el.value,
125+
);
126+
$replaceInput.el.value = newValue;
127+
} else if (e.key === "Enter" || e.key === "Escape") {
128+
// Reset navigation on enter or escape
129+
searchHistory.resetReplaceNavigation();
130+
}
131+
});
132+
133+
// Reset navigation when user starts typing
134+
$replaceInput.el.addEventListener("input", () => {
135+
searchHistory.resetReplaceNavigation();
136+
});
137+
}
138+
}
139+
78140
export const key = {
79141
get shift() {
80142
return state.shift;
@@ -169,10 +231,16 @@ export default function actions(action, value) {
169231
return true;
170232

171233
case "search-prev":
234+
if (quickTools.$searchInput.el.value) {
235+
searchHistory.addToHistory(quickTools.$searchInput.el.value);
236+
}
172237
find(1, true);
173238
return true;
174239

175240
case "search-next":
241+
if (quickTools.$searchInput.el.value) {
242+
searchHistory.addToHistory(quickTools.$searchInput.el.value);
243+
}
176244
find(1, false);
177245
return true;
178246

@@ -181,10 +249,16 @@ export default function actions(action, value) {
181249
return true;
182250

183251
case "search-replace":
252+
if ($replaceInput.value) {
253+
searchHistory.addToHistory($replaceInput.value);
254+
}
184255
editor.replace($replaceInput.value || "");
185256
return true;
186257

187258
case "search-replace-all":
259+
if ($replaceInput.value) {
260+
searchHistory.addToHistory($replaceInput.value);
261+
}
188262
editor.replaceAll($replaceInput.value || "");
189263
return true;
190264

@@ -227,9 +301,15 @@ function toggleSearch() {
227301
};
228302

229303
$searchInput.onsearch = function () {
230-
if (this.value) find(1, false);
304+
if (this.value) {
305+
searchHistory.addToHistory(this.value);
306+
find(1, false);
307+
}
231308
};
232309

310+
// Setup history navigation for search inputs
311+
setupHistoryNavigation();
312+
233313
setFooterHeight(2);
234314
find(0, false);
235315

@@ -327,6 +407,10 @@ function removeSearch() {
327407
$footer.removeAttribute("data-searching");
328408
$searchRow1.remove();
329409
$searchRow2.remove();
410+
411+
// Reset history navigation when search is closed
412+
searchHistory.resetAllNavigation();
413+
330414
const { activeFile } = editorManager;
331415

332416
// Check if current tab is a terminal

0 commit comments

Comments
 (0)