Commit graph

65 commits

Author SHA1 Message Date
Donald Green
f07963f930 Bug fixes for bell configuration (#3850)
* 1. Restored the ability to turn the "bell" sound on and off using the "bell" config parameter.
2. Restored the ability to change the bell sound by providing a URL. These changes allow for a web url or local absolute file path to an audio file.

The goal with these changes was to fix the issue causing the bell to never sound due to a difference in the underlying terminal emulators configurations from the previous one. While in the area, also decided to make sure that the sound can be changed by supplying a web url to an audio file or an absolute path to an audio file within the local machine

* Code style changes

* Code style changes

* 1. More code style changes

* 1. Spacing changes to try and abide by the linter

* 1. Applied all suggested changes by eslint

* 1. Removed functionality to specify a remote url to set a sound file for the bell sound. The amount of effort for handling when there is no internet connection, queuing and so forth wasn't worth keeping the feature. It is likely that the url could be used to download the file in which the user would be able to specify the file path tho this download file.
2. Created a new property that gets passed down from the terms container all the way to the individual term. We want to be able to evaluate if the bellSoundURL has changed to determine if we really need to read the sound file.
3. Moved logic to read the audio file into the main process. Setup a new action in the 'actions/ui' that will update the bell sound when it is finished and ready. This should prevent blocking the terminal from loading and thus increasing loading times.

* 1. Modified the file reading method to be more generic to increase reusability.
2. Updated the "arrBuf2Base64" method to utilize the node Buffer class which helped to reduce some complexity and seems to run more efficiently.
3. Removed the CONFIG_ASYNC action and reducer in favor of reusing CONFIG_RELOAD when the process is finished reading the file for the bell sound. In order to achieve this, we had to merge the config from "config.getConfig()" method with the "bellSound" property before dispatching to "reloadConfig".

* 1. Removed reference to now removed method

* 1. Removed the arrBuf2Base64 as it seemed unnecessary now that the function would be reduced to a single line. Moved the one-liner into file.js. Removed references to arrBuf2Base64 method.
2. Refactored the logic that handles reloading the config when it has been updated to fix an issue that would set the bell sound back to the default sound when the config is saved without changing the value of "bellSoundURL". Setup now to either read file and reload the config, or reuse the "bellSound" value saved in state and reload the config. This removes an inefficiency with the reloadConfig being dispatched twice when "bellSoundURL" has changed as well.

* 1. Removed a file that contained a single function, referenced in only one place that is performing a fairly simple task.
2. Updated the "getBase64FileData" method to use "Buffer.from()" instead of "Buffer()" due to messages stating that "Buffer()" is deprecated due to security and usability issues.

* Adjustments and regression issues fixed

1. Updated the default config file to better explain the supported options for the "bell" config property.
2. Rearranged the bellSoundURL default property to make it easier to find should one decide to change the bell sound.
3. Typos fixed in comments.
4. Update fetchFileData to utilize the configData provided as function argument. There appeared to be no reason to reference different sources of config data within the same method.

* 1. Removed the "BELL_STYLE" constant since it was only being used in one place.
2. Updated comment block to accurately reflect the current logic and made the comment much more concise.

* 1. Add null safety check on `configInfo.bell` if the config file does not contain this property.
2. Default bellSound to null if the file specified by the filepath in `configInfo.bellSoundUrl` failed to be read. This helps prevent a repeated error being thrown by the xterm instance.
3. Updated `term.js` to use componentDidUpdate in place of the UNSAFE lifcycle method `componentWillReceiveProps`. I found that this unsafe lifecycle was never being fired, which lead to the terminal never responding to configuration changes. Without this change, the custom bell sound was never being loaded into the xterm instance.
2019-10-08 17:13:35 +02:00
Benjamin Staneck
850c66d1b6 run linter 2019-10-03 04:04:43 +02:00
Labhansh Agrawal
b52d8152bf Upgrade eslint to v6 and add TypeScript linting (#3843)
* Upgrade eslint to v6 and add TypeScript linting

* Fix pr checks


Co-authored-by: Benjamin Staneck <Stanzilla@users.noreply.github.com>
2019-10-03 02:56:50 +02:00
Donald Green
5d7142c2df Return of the Bell (#2938)
* 1. Restored the ability to turn the "bell" sound on and off using the "bell" config parameter.
2. Restored the ability to change the bell sound by providing a URL. These changes allow for a web url or local absolute file path to an audio file.

The goal with these changes was to fix the issue causing the bell to never sound due to a difference in the underlying terminal emulators configurations from the previous one. While in the area, also decided to make sure that the sound can be changed by supplying a web url to an audio file or an absolute path to an audio file within the local machine

* Code style changes

* Code style changes

* 1. More code style changes

* 1. Spacing changes to try and abide by the linter

* 1. Applied all suggested changes by eslint

* 1. Removed functionality to specify a remote url to set a sound file for the bell sound. The amount of effort for handling when there is no internet connection, queuing and so forth wasn't worth keeping the feature. It is likely that the url could be used to download the file in which the user would be able to specify the file path tho this download file.
2. Created a new property that gets passed down from the terms container all the way to the individual term. We want to be able to evaluate if the bellSoundURL has changed to determine if we really need to read the sound file.
3. Moved logic to read the audio file into the main process. Setup a new action in the 'actions/ui' that will update the bell sound when it is finished and ready. This should prevent blocking the terminal from loading and thus increasing loading times.

* 1. Modified the file reading method to be more generic to increase reusability.
2. Updated the "arrBuf2Base64" method to utilize the node Buffer class which helped to reduce some complexity and seems to run more efficiently.
3. Removed the CONFIG_ASYNC action and reducer in favor of reusing CONFIG_RELOAD when the process is finished reading the file for the bell sound. In order to achieve this, we had to merge the config from "config.getConfig()" method with the "bellSound" property before dispatching to "reloadConfig".

* 1. Removed reference to now removed method

* 1. Removed the arrBuf2Base64 as it seemed unnecessary now that the function would be reduced to a single line. Moved the one-liner into file.js. Removed references to arrBuf2Base64 method.
2. Refactored the logic that handles reloading the config when it has been updated to fix an issue that would set the bell sound back to the default sound when the config is saved without changing the value of "bellSoundURL". Setup now to either read file and reload the config, or reuse the "bellSound" value saved in state and reload the config. This removes an inefficiency with the reloadConfig being dispatched twice when "bellSoundURL" has changed as well.

* 1. Removed a file that contained a single function, referenced in only one place that is performing a fairly simple task.
2. Updated the "getBase64FileData" method to use "Buffer.from()" instead of "Buffer()" due to messages stating that "Buffer()" is deprecated due to security and usability issues.

* Adjustments and regression issues fixed

1. Updated the default config file to better explain the supported options for the "bell" config property.
2. Rearranged the bellSoundURL default property to make it easier to find should one decide to change the bell sound.
3. Typos fixed in comments.
4. Update fetchFileData to utilize the configData provided as function argument. There appeared to be no reason to reference different sources of config data within the same method.

* 1. Removed the "BELL_STYLE" constant since it was only being used in one place.
2. Updated comment block to accurately reflect the current logic and made the comment much more concise.
2019-10-03 02:08:40 +02:00
Labhansh Agrawal
8524d37f9e Port array.js and file.js to typescript 2019-09-23 17:55:53 +02:00
Philippe Potvin
d0f03f52e5
url are now interpreted by xterm (#3507)
* url are now interpreted by xterm

* no need

* .DS_STORE banished

* remove from reducer
2019-03-03 13:13:50 -05:00
Umberto Lentini
ba93421933 Fixed file paste (#3383)
Fixes #3340
2019-01-06 15:55:16 +01:00
Prashant Andani
436c37e89e Code cleanup (#3131) 2018-10-13 16:35:51 +02:00
CHaBou
bc6101e98f
Fix module hijacking (#3067)
Regression was introduced by #2866. Release version of Hyper failed to start.
2018-06-11 08:43:57 +02:00
Timo Welde
f75895a176 Fix plugin module hijacking on main process (#2866)
Fixes some plugin loading (like hyperline)
2018-05-15 15:58:36 +02:00
Sonny
f64e3e0204 Adding ability to send error object to notify() (#2955) 2018-05-02 10:10:44 +02:00
CHaBou
dc33d4846b
Fix color configuration with an array (#2729)
Fixes #2728
2018-03-21 10:00:29 +01:00
Timothy
20173f0e86 Migrate styling to styled-jsx (#2761)
Fixes #2737
2018-03-17 13:51:36 +01:00
Benjamin Staneck
9df56a7fe0 Update electron to v1.7.10 and other dependencies (#2583)
* Update electron to v1.7.10

Changelog: https://github.com/electron/electron/releases/tag/v1.7.10

* Update yarn-standalone.js to v1.3.2

Changelog: https://github.com/yarnpkg/yarn/releases/tag/v1.3.2

* Update various dependencies

* update electron-builder, electron-rebuild and prettier

* Use the recommended way to install yarn on travis

See https://yarnpkg.com/lang/en/docs/install-ci/#travis-tab
2018-01-21 10:21:41 +01:00
CHaBou
8ce71b9d88
Fix component decoration in renderer (#2454)
* Fix decorateNotification

* Fix typo

* Fix plugin decoration in renderer
2017-11-13 16:02:49 +01:00
CHaBou
3a3ee013f7
Enhance plugin installation (#2440) 2017-11-08 22:24:15 +01:00
Benjamin Staneck
8fc75b15ff Unify wording and spelling in config and other places (#2422) 2017-11-04 23:19:02 +01:00
CHaBou
2af575c3c0 Multiple keymaps and mousetrap (#2412)
* WIP

* WIP

* Wip

* Wip

* wip

* Refactor without normalize and plugin

* Replace extendKeymaps by decorateKeymaps

* WIP

* Add mousetrap

* Add first command over rpc

* More commands

* Add all commands

* Begin to hook commands

* Working multiple keymaps

* Use redux action to trigger command

* Use forked version of Mousetrap to capture key events

* Fix lint

* Add command in redux action to debug purpose

* ExecCommand from menu click

* Remove unused files

* Fix xterm should ignore catched events

* Re-enable IntelliSense checking

* Remove unused runes dep
2017-11-02 19:51:18 -07:00
Derrick Pelletier
280f14e239 Pasting a copied file or dir provides full path to resource (#2364)
* Added a utility for processing clipboard data

* using paste processing utility in term component to expand filepath

* removed linux case

* moved active tab to guard so only process when active

* commenting paste event handler for clarity
2017-10-22 23:16:52 +02:00
Evan
e29651bbe3 Fix typo in comment (#2383)
Pointless typo fix
2017-10-21 21:56:41 +02:00
CHaBou
7f1baff5e1 Fix keyboard event handling (#2331)
Implement Mousetrap-like keyboard handling
2017-10-05 20:40:02 +02:00
CHaBou
d3cd9aee00
Merge branch 'master' into canary 2017-09-20 01:39:55 +02:00
Wilson Tayar
4c71c99325 Normalize keymap internals (#2227)
Fix #2195: normalizing keybindings using localeCompare to include non english keyboards as well
2017-09-20 01:36:06 +02:00
CHaBou
f8c19b0ef2
Merge branch 'master' into v2 2017-09-17 23:08:33 +02:00
CHaBou
e0d793eeeb Revert "Normalize keymap internals" (#2225)
This reverts commit 751c06e437.
2017-09-17 21:53:37 +01:00
CHaBou
7733067deb
Merge branch 'master' into v2 2017-09-17 10:48:16 +02:00
Wilson Tayar
751c06e437 Normalize keymap internals (#2210)
Fix #2195
2017-09-17 10:43:58 +02:00
CHaBou
f8366d010d
Upgrade React to v16
* Introduce 2 base components: Component and PureComponent. Before, we have only PureComponent but it was impossible to add a shoulComponentUpdate method (used for Terms).
2017-09-16 21:21:50 +02:00
CHaBou
9bd410f1e4
Make Hyper more robust against plugins
* Add some try/catch
* Support React@16 error boundaries for render decorated components
2017-09-13 22:55:54 +02:00
CHaBou
1155bb54b1
Add prettier and resolve all lint errors 2017-09-10 16:04:13 +02:00
CHaBou
a9bb9b697b
Add depreaction warning for hterm css
* Notify user when its config conatins deprecated CSS classes
* Add warning in devtools console about plugins using deprecated classes
2017-09-10 11:35:39 +02:00
Adam Bosco
d9dc415eff Normalize shell name before selecting URL-matching regex (#2070) 2017-08-10 10:45:02 -04:00
CHaBou
db35faa431 Show plugin (name and version) loaded (#1826)
* Print plugin name and version in devtools
* Add plugins informations in About dialog
2017-06-19 23:02:53 +02:00
Philippe Potvin
93b2229ff5 Implements Commands Key mapping (#1876)
Keymaps part 2
2017-06-02 20:03:47 -04:00
Albin Ekblom
216c475c2b Use native Object.values()` (#1880) 2017-05-27 23:42:42 -04:00
Albin Ekblom
af43bbbfed Proxy ReactDOM for plugins (#1878)
* Proxy ReactDOM for plugins

* Update Module._load comment
2017-05-27 15:37:41 -04:00
CHaBou
f3594b3b14 Add displayName for each plugin HOC (#1735) 2017-04-12 11:22:51 -07:00
CHaBou
7a64c9ee8a Add onDecorated property to decorated components (#1680) 2017-03-27 17:07:55 -07:00
Guillermo Rauch
12ae25a60b 20% faster bootup time (#1350)
* bump webpack, babel and include babili

* fix for babili

* add heuristics for faster v8 parsing

* lint fixes

* fix windows build. infinitely grateful to @stefanivic for helping us test windows
2017-01-09 13:32:15 -08:00
Tim Neutkens
f6eaef9457 Expose decorate to plugins (#1261) 2016-12-31 20:26:10 -08:00
Philippe Potvin
b2f67c73e4 Fix url interpretation (#1259)
* Fix url interpretation

* update regex
2016-12-17 14:17:58 -08:00
Kevin Ramsunder
63ab44778b Do not match extra '.' symbol in domain regex (#1216) 2016-12-14 19:21:22 -05:00
Philippe Potvin
d459112676 Add missing param (#1090) 2016-12-06 01:35:40 -02:00
Tim Neutkens
cd47cc7636 Allow require of plugin apis (#977)
* Allow require of plugin apis

* missing semicolon
2016-11-19 18:18:07 -02:00
Philippe Potvin
26701d43b5 Fix selection extend when copyOnSelect is true (#975) 2016-11-10 00:03:08 -02:00
Oliver Dunk
6b385036d7 Change URL regex - fixes #867 (#943) 2016-10-29 13:13:53 +02:00
David Gómez
8f28573fc0 Prefer default export to make XO happy (#931)
* Comply with prefer-default-export rule for findBySession function

* Remove XO's prefer-default-export rule

* Comply with prefer-default-export rule for init function

* Comply with prefer-default-export rule for getRootGroups function

* Comply with prefer-default-export rule for INIT constant

* Comply with prefer-default-export rule for isExecutable function

* Fix default export for constants

* Comply with prefer-default-export rule for last function

* Comply with prefer-default-export rule for getColorList function
2016-10-25 14:53:15 +02:00
Martin Ek
7a08b1dc3e Fix xo 0.17 errors and use root xo config for app (#859)
* Use parent xo config in app/

* lint: Fix xo 0.17 errors

* app: add missing semver dependency
2016-10-12 20:35:44 -05:00
Hrvoje Šimić
7e71bf356b fix various typos and grammar errors in comments (#834) 2016-10-10 12:26:47 +02:00
Martin Ek
fe91b4c76e Refactor plugin retrieval (#695)
* plugins: refactor props decorators

* plugins: add missing plugin functions to notifier

* plugins: refactor reducer decorators

* bug: make sure reduceTermGroups are added from plugins
2016-10-08 14:38:47 -07:00