Skip to content

Commit

Permalink
feat(ext): Replace shell select with input
Browse files Browse the repository at this point in the history
It not of much help imposing this restriction if a user already chose
Custom. And this is probably also needed for it to work under Windows,
since most people don't put their bash.exe into system search path.
  • Loading branch information
Frederick888 committed Jul 8, 2022
1 parent d47afc6 commit 9724247
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 1 addition & 7 deletions extension/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@
<tr id="shell-row" style="display: none;">
<td><label>Shell</label></td>
<td>
<select name="shell" id="shell">
<option value="sh">sh</option>
<option value="bash">bash</option>
<option value="ash">ash</option>
<option value="dash">dash</option>
<option value="dash">zsh</option>
</select>
<input name="shell" id="shell" type="text" value="sh" />
</td>
</tr>
<tr id="template-row">
Expand Down
6 changes: 3 additions & 3 deletions extension/options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const editorSelect = document.getElementById('editor')
const terminalRow = document.getElementById('terminal-row')
const terminalSelect = document.getElementById('terminal')
const shellRow = document.getElementById('shell-row')
const shellSelect = document.getElementById('shell')
const shellInput = document.getElementById('shell')
const templateInput = document.getElementById('template')
const bypassVersionCheckInput = document.getElementById('bypass-version-check')
const applyButton = document.getElementById('apply')
Expand Down Expand Up @@ -104,7 +104,7 @@ async function updateTemplate() {
async function saveSettings() {
const editor = editorSelect.value
const terminal = terminalSelect.value
const shell = editor === 'custom' ? shellSelect.value : 'sh'
const shell = editor === 'custom' ? shellInput.value : 'sh'
const template = templateInput.value
const bypassVersionCheck = bypassVersionCheckInput.checked
await browser.storage.local.set({
Expand All @@ -121,7 +121,7 @@ async function loadSettings() {
if (settings.editor) {
editorSelect.value = settings.editor
terminalSelect.value = settings.terminal
shellSelect.value = settings.shell
shellInput.value = settings.shell
templateInput.value = settings.template
bypassVersionCheckInput.checked = settings.bypassVersionCheck
updateOptionsForEditor(settings.editor)
Expand Down

0 comments on commit 9724247

Please sign in to comment.