Reformat existing gdscript code

This commit is contained in:
Leroy Hopson 2022-06-04 11:27:46 +07:00
parent ae707a6667
commit deb68e323c
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
9 changed files with 269 additions and 108 deletions

View file

@ -12,13 +12,13 @@ enum CWDType {
### Shortcuts ###
export (ShortCut) var new_terminal_shortcut = preload("./default_new_terminal_shortcut.tres")
export (ShortCut) var kill_terminal_shortcut = preload("./default_kill_terminal_shortcut.tres")
export (ShortCut) var copy_shortcut = preload("./default_copy_shortcut.tres")
export (ShortCut) var paste_shortcut = preload("./default_paste_shortcut.tres")
export(ShortCut) var new_terminal_shortcut = preload("./default_new_terminal_shortcut.tres")
export(ShortCut) var kill_terminal_shortcut = preload("./default_kill_terminal_shortcut.tres")
export(ShortCut) var copy_shortcut = preload("./default_copy_shortcut.tres")
export(ShortCut) var paste_shortcut = preload("./default_paste_shortcut.tres")
export (ShortCut) var next_tab_shortcut = preload("./default_tab_right_shortcut.tres")
export (ShortCut) var previous_tab_shortcut = preload("./default_tab_left_shortcut.tres")
export(ShortCut) var next_tab_shortcut = preload("./default_tab_right_shortcut.tres")
export(ShortCut) var previous_tab_shortcut = preload("./default_tab_left_shortcut.tres")
### Scroll settings ###
@ -44,10 +44,10 @@ export var audio_bell := true
export var bell_sound: AudioStream
# Exec args.
export (FileType) var file_type := FileType.USE_SHELL_ENV
export(FileType) var file_type := FileType.USE_SHELL_ENV
export var custom_file := "/bin/sh"
export (CWDType) var cwd_type := CWDType.USE_PROJECT_DIRECTORY
export(CWDType) var cwd_type := CWDType.USE_PROJECT_DIRECTORY
export var custom_cwd := ""
export var args := PoolStringArray()

View file

@ -8,26 +8,31 @@ extends Object
const LibuvUtils := preload("./libuv_utils.gdns")
static func get_os_environ() -> Dictionary:
# While Godot has OS.get_environment(), I could see a way to get all environent
# variables, other than by OS.execute() which would require to much platform
# specific code. Easier to use libuv's utility function.
return LibuvUtils.new().get_os_environ()
static func get_cwd() -> String:
# Use uv_cwd() rather than Directory.get_current_dir() because the latter
# defaults to res:// even if starting godot from a different directory.
return LibuvUtils.new().get_cwd()
static func get_windows_build_number() -> int:
assert(OS.get_name() == "Windows", "This function is only supported on Windows.")
var release: String = LibuvUtils.new().get_os_release()
assert(false, "Not implemented.")
return 0
static func kill(pid: int, signum: int):
if pid > 1:
return LibuvUtils.new().kill(pid, signum)
static func new():
assert(false, "Abstract sealed (i.e. static) class should not be instantiated.")

View file

@ -42,7 +42,7 @@ enum Signal {
signal data_received(data)
signal exited(exit_code, signum)
export (NodePath) var terminal_path := NodePath() setget set_terminal_path
export(NodePath) var terminal_path := NodePath() setget set_terminal_path
var _terminal: Terminal = null setget _set_terminal
@ -53,18 +53,18 @@ var _terminal: Terminal = null setget _set_terminal
var _pid: int
# The column size in characters.
export (int) var cols: int = DEFAULT_COLS setget set_cols
export(int) var cols: int = DEFAULT_COLS setget set_cols
# The row size in characters.
export (int) var rows: int = DEFAULT_ROWS setget set_rows
export(int) var rows: int = DEFAULT_ROWS setget set_rows
# Environment to be set for the child program.
export (Dictionary) var env := DEFAULT_ENV
export(Dictionary) var env := DEFAULT_ENV
# If true the environment variables in the env Dictionary will be merged with
# the environment variables of the operating system (e.g. printenv), with the
# former taking precedence in the case of conflicts.
export (bool) var use_os_env := true
export(bool) var use_os_env := true
# (EXPERIMENTAL)
# If true, PTY node will create a blocking libuv loop in a new thread.

View file

@ -3,11 +3,11 @@ extends Animation
signal data_written(data)
signal data_read(data)
export (int) var version: int = 2
export(int) var version: int = 2
# Initial terminal width (number of columns).
export (int) var width: int
export(int) var width: int
# Initial terminal height (number of rows).
export (int) var height: int
export(int) var height: int
func get_class() -> String:

View file

@ -24,13 +24,13 @@ enum SelectionMode {
POINTER,
}
export (UpdateMode) var update_mode = UpdateMode.AUTO setget set_update_mode
export(UpdateMode) var update_mode = UpdateMode.AUTO setget set_update_mode
var cols = 2
var rows = 2
# If true, text in the terminal will be copied to the clipboard when selected.
export (bool) var copy_on_selection
export(bool) var copy_on_selection
# Bell
# If muted, the "bell" signal will not be emitted when the bell "\u0007" character